Archive for April, 2007

Chapter 2 . Running Commands from the (Linux web host) Shell

Saturday, April 28th, 2007

Chapter 2 . Running Commands from the Shell 49 a typed character that has special meaning to the shell for connecting commands or requesting expansion. Piping Commands The pipe (|) metacharacter connects the output from one command to the input of another command. This lets you have one command work on some data, and then have the next command deal with the results. Here is an example of a command line that includes pipes: $ cat /etc/password | sort | less This command lists the contents of the /etc/password file and pipes the output to the sort command. The sort command takes the usernames that begin each line of the /etc/password file, sorts them alphabetically, and pipes the output to the less command (to page through the output). Pipes are an excellent illustration of how UNIX, the predecessor of Linux, was created as an operating system made up of building blocks. A standard practice in UNIX was to connect utilities in different ways to get different jobs done. For example, before the days of graphical word processors, users created plain-text files that included macros to indicate formatting. To see how the document really appeared, they would use a command such as the following: $ gunzip < /usr/share/man/man1/grep.1.gz | nroff -c -man | less In this example, the contents of the grep man page (grep.1.gz) are directed to the gunzip command to be unzipped. The output from gunzip is piped to the nroff command to format the man page using the manual macro (-man). The output is piped to the less command to display the output. Because the file being displayed is in plain text, you could have substituted any number of options to work with the text before displaying it. You could sort the contents, change or delete some of the content, or bring in text from other documents. The key is that, instead of all those features being in one program, you get results from piping and redirecting input and output between multiple commands. Sequential Commands Sometimes you may want a sequence of commands to run, with one command completing before the next command begins. You can do this by typing several commands on the same command line and separating them with semicolons (;): $ date ; troff -me verylargedocument | lpr ; date In this example, I was formatting a huge document and wanted to know how long it would take. The first command (date) showed the date and time before the formatting started. The troff command formatted the document and then piped the output to the printer. When the formatting was done, the date and time was printed again (so I knew how long the troff command took to complete).
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision personal web hosting services

48 Part I . Linux First Steps Instead (Web design course)

Friday, April 27th, 2007

Free web hosting music - Chapter 2 . Running Commands from the Shell

Friday, April 27th, 2007

Web hosting resellers - 46 Part I . Linux First Steps The

Friday, April 27th, 2007

Chapter 2 . Running Commands from the Shell (Web design templates)

Friday, April 27th, 2007

44 Part I . Linux First Steps Table (Database web hosting)

Thursday, April 26th, 2007

Chapter 2 . Running Commands from the (Com web hosting) Shell

Thursday, April 26th, 2007

Post office web site - 42 Part I . Linux First Steps directories),

Thursday, April 26th, 2007

Chapter 2 . Running Commands from the Shell (Web site management)

Thursday, April 26th, 2007

Web design - 40 Part I . Linux First Steps Unless

Wednesday, April 25th, 2007