Using the Bash Shell140Typing less with automatic command (X web hosting)

Using the Bash Shell140Typing less with automatic command completionMany commands take a filename as an argument. To view the contents of the/etc/modprobe.conftext file, for example, type the following command: cat /etc/modprobe.confThe catcommand displays the /etc/modprobe.conffile. For any com- mand that takes a filename as an argument, you can use a Bash feature toavoid having to type the whole filename. All you have to type is the bareminimum just the first few characters to uniquely identify the file in itsdirectory. To see an example, type cat /etc/modbut don t press Enter; press Tabinstead. Bash automatically completes the filename, so the commandbecomes cat /etc/modprobe.conf. Now press Enter to run the command. Whenever you type a filename, press Tab after the first few characters of thefilename. Bash probably can complete the filename so that you don t have totype the entire name. If you don t enter enough characters to uniquely iden- tify the file, Bash beeps. Just type a few more characters and press Tab again. Going wild with asterisks and question marksYou can avoid typing long filenames another way. (After all, making less workfor users is the idea of computers, isn t it?) This particular trick involves using the asterisk (*) and question mark (?) and a few more tricks. These special characters are called wildcardsbecausethey match zero or more characters in a line of text. If you know MS-DOS, you may have used commands such as COPY *.* A:tocopy all files from the current directory to the A drive. Bash accepts similarwildcards in filenames. As you d expect, Bash provides many more wildcardoptions than the MS-DOS command interpreter does. You can use three types of wildcards in Bash: .The asterisk (*)character matches zero or more characters in a file- name. That means * denotes all files in a directory. .The question mark (?)matches any single character. If you type test?, that matches any five-character text that begins with test. .A set of characters in bracketsmatches any single character from thatset. The string [aB]*, for example, matches any filename that startswith aor B.
Looking for affordable and reliable webhost to host and run your business application? Then look no more and go to servlet web hosting services.

Leave a Reply