Spring Switzerland GmbH 2000 Desktop enviroments in the data bars, Manipulation of text files

Page 12

Manipulation of text files

diff compares two files and reports the differences. grep search file for pattern (regular expression). sort sorts textfiles.

head prints first 10 lines of file.

tail prints (surprise) last 10 lines of file.

a2ps “pretty-prints” ASCII files on a printer – actually a PostScript file i generated and sent to a printer. wc counts lines/words/letters in a file.

Redirection of input or output

To redirect the input or output for a program invoked by a command you use < and >. For example to redirect the output from a directory listing (command ls) to outputfile , you would do the following: ls > outputfile . To redirect the input from a file, you use <

Pipelines

Pipelines allow you to let the output of one program be used as input to another program. This is done in a command line containing several commands separated by bar characters “ ”. Each bar denotes a pipeline which “pipes” the output of the command to the left of the bar to the input of the command to the right of the bar.

Example: let's assume that you have created a program that outputs textlines, and you want to see the

first 15 lines containing the word “hello world”, you would execute the following: myprogram

grep helloworld head -n 15

11 Desktop enviroments in the data bars

The graphics subsystem in Linux is an implementation of The X Window System or just X for short. It implements the basic graphic and windowing primitives and it is totally network transparent (unlike the graphics system of another well-known operating system). This means that you can run an entire session, or just a single application on any other computer in the data bar system from a PC in the data bar.

A window manager works on top of the graphics subsystem and it implements the lay-out of windows (borders, buttons, etc.), how to move windows around, how to use menus, and so on. The term desktop enviroment covers X, a windowmanager and a suite of utilites, configuration programs, games, editors and so on.

12

Image 12
Contents Spring term Using Linux at the ITU data bars ContentsLogging Executing commands via the button-bar Windows and icons WindowPrinting Running Java programs Running SML programsEmacs editor with an SML program SML system functions File, directories and paths DBD*,+--./.!0-!1*$324504 Star OfficeSome useful Unix commands Online documentationChanging password Using filesUsing floppy-disks Creating and removing directoriesDesktop enviroments in the data bars Manipulation of text filesRedirection of input or output PipelinesMore about Linux KDE The K Desktop EnviromentWindowMaker Gnome GNu Object Model EnviromentDanish user groups Getting Linux on your own machine