Photo web hosting - Chapter 2 . Running Commands from the Shell
Friday, July 27th, 2007Chapter 2 . Running Commands from the Shell 65 match one or more files without typing each file completely. Operators let you direct information from one command or file to another command or file. Using File-Matching Metacharacters To save you some keystrokes and to be able to refer easily to a group of files, the bash shell lets you use metacharacters. Anytime you need to refer to a file or directory, such as to list it, open it, or remove it, you can use metacharacters to match the files you want. Here are some useful metacharacters for matching filenames: . * Matches any number of characters. . ? Matches any one character. . […] Matches any one of the characters between the brackets, which can include a dash-separated range of letters or numbers. Try out some of these file-matching metacharacters by first going to an empty directory (such as the test directory described in the previous section) and creating some empty files: $ touch apple banana grape grapefruit watermelon Identifying Directories When you need to identify your home directory on a shell command line, you can use the following: . $HOME This environment variable stores your home directory name. . ~ The tilde (~) represents your home directory on the command line. You can also use the tilde to identify someone else s home directory. For example, ~chris would be expanded to the chris home directory (probably /home/chris). Other special ways of identifying directories in the shell include the following: . . A single dot (.) refers to the current directory. . .. Two dots (..) refer to a directory directly above the current directory. . $PWD This environment variable refers to the current working directory. . $OLDPWD This environment variable refers to the previous working directory before you changed to the current one.
We highly recommend you visit web and email hosting services if you need stable and cheap web hosting platform for your web applications.