Web hosting solutions - Using the Bash Shell138changes the current directory to

Using the Bash Shell138changes the current directory to your home directory, lists the contents ofthat directory, and then shows the name of that directory. Combining shell commandsYou can combine simple shell commands to create a more sophisticatedcommand. Suppose you want to find out whether a device file named sbpcdresides in your system s /devdirectory because some documentation saysyou need that device file for a Sound Blaster Pro CD-ROM drive. You can usethe ls /devcommand to get a directory listing of the /devdirectory andthen browse through it to see whether that listing contains sbpcd. Unfortunately, the /devdirectory has a great many entries, so finding anyitem that has sbpcdin its name may be hard. You can, however, combine thelscommand withgrepand come up with a command line that does exactlywhat you want. Here s that command line: ls /dev | grep sbpcdThe shell sends the output of the lscommand (the directory listing) to thegrepcommand, which searches for the string sbpcd. That vertical bar (|) isknown as a pipebecause it acts as a conduit (think of a water pipe) betweenthe two programs the output of the first command is fed into the input ofthe second one. Controlling command input and outputMost Linux commands have a common feature they always read from thestandard input (usually, the keyboard) and write to the standard output(usually, the screen). Error messages are sent to the standard error (usuallyto the screen as well). These three devices often are referred to as stdin, stdout, and stderr. You can make a command get its input from a file and then send its output toanother file. Just so you know, the highfalutin term for this feature is inputand output redirectionor I/O redirection. Getting command input from a fileIf you want a command to read from a file, you can redirect the standardinput to come from that file instead of the keyboard. For example, type thefollowing command: sort < /etc/passwdThis command displays a sorted list of the lines in the /etc/passwdfile. Inthis case, the less-than sign (<) redirects stdinso that the sortcommandreads its input from the /etc/passwdfile.
If you are in need for cheap and reliable webhost to host your website, we recommend http web server services.

Leave a Reply