Dedicated web hosting - Of course, this can be inconvenient, especially if
Of course, this can be inconvenient, especially if the command resides in a directory with a long name. The better way is to have commands stored in well-known directories, and then add those directories to your shell s PATH environment variable. The path consists of a list of directories that are checked sequentially for the commands you enter. To see your current path, type the following: $ echo $PATH /bin:/usr/bin:/usr/local/bin:/usr/bin/X11:/usr/X11R6/bin:/home/chris/bin The results show the default path for a regular Linux user. Directories in the path list are separated by colons. Most user commands that come with Linux are stored in the /bin, /usr/bin, or /usr/local/bin directories. Graphical commands (that are used with GUIs) are contained in /usr/bin/X11 and /usr/X11R6/bin directories. The last directory shown is the bin directory in the user s home directory. Tip If you want to add your own commands or shell scripts, place them in the bin directory in your home directory (such as /home/chris/bin for the user named chris). This directory is automatically added to your path. So as long as you add the command to your bin with execute permission (described in the “Understanding file permissions” section), you can immediately begin using the command by simply typing the command name at your shell prompt. If you are the root user, directories containing administrative commands are in your path. These directories include /sbin and /usr/sbin. The path directory order is important. Directories are checked from left to right. So, in this example, if there was a command called foo located in both the /bin and /usr/bin directories, the one in /bin would be executed. To have the other foo command run, you would have to either type the full path to the command or change your PATH variable. (See the section on configuration files later in this chapter for information on changing your PATH or adding directories to it.) Not all the commands that you run are located in directories in your PATH. Some commands are built into the shell. Other commands can be overridden by creating aliases that define any commands and options that you want the command to run. There are also ways of defining a function that consists of a stored series of commands. Here is the order in which the shell checks for the commands you type: 1. Aliases Names set by the alias command that represent a particular command and a set of options. 2. Shell reserved word Words that are reserved by the shell for special use. Most of these are words that you would use in programming-type functions, such as do, while, case, and else. 3. Function A set of commands that are executed together within the current shell. 4. Built-in command A command that is built into the shell. 5. File system command This is a command that is stored in and executed from the computer s file system. (These are the commands that are indicated by the value of the PATH variable.) Note To see a list of bash built-in commands (and options), type the help command. For more information on a particular built-in, use the info command, followed by the name of the built-in command. To find out where a particular command is taken from, you can use the type command. For example, to find out where the bash shell command is located, type the following: $ type bash
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision virtual web hosting services