Environment variables The shell itself stores information (Space web hosting)

Environment variables The shell itself stores information that may be useful to the user s shell session in what are called environment variables. Examples of environment variables include $SHELL (which identifies the shell you are using), $PS1 (which defines your shell prompt), and $MAIL (which identifies the location of your mailbox). Tip You can check your environment variables at any time. Type declare to list the current environment variables. Or you can type echo $VALUE, where VALUE is replaced by the name of a particular environment variable you want to list. Metacharacters These are characters that have special meaning to the shell. Metacharacters can be used to direct the output of a command to a file (>), pipe the output to another command (|), or run a command in the background (&), to name a few. Metacharacters are discussed later in this chapter. To save you some typing, there are shell features that store commands you want to reuse, recall previous commands, and edit commands. You can create aliases that allow you to type a short command to run a longer one. The shell stores previously entered commands in a history list, which you can display and from which you can recall commands. This is discussed further in the remainder of this section. Unless you specifically change to another shell, the bash shell is the one you use with Red Hat Linux. The bash shell contains most of the powerful features available in other shells. Although the description in this chapter steps you through many bash shell features, you can learn more about the bash shell by typing man bash. For other ways to learn about using the shell, refer to the sidebar Getting Help with Using the Shell. Getting Help with Using the Shell When you first start using the shell, it can be intimidating. All you see is a prompt. How do you know which commands are available, which options they use, or how to use more advanced features? Fortunately, lots of help is available. Here are some places you can look to supplement what you learn in this chapter: Check the PATH Type echo $PATH. The result is a listing of the directories containing commands that are immediately accessible to you. Listing the contents of those directories displays most of the standard Linux commands. Use the help command Some commands are built into the shell, so they do not appear in a directory. The help command lists those commands and shows you the options available with each of them. (Because the list is long, type help | more to page through the list.) For help with a particular built-in command, type help command, replacing command with the name that interests you. Use the man command If you know a command name and want to find out more about it, type man command. Replace command with the command name in which you are interested. A description of the command and its options appears on the screen. Locating commands If you know where a command is located in your Linux file system, one way to run it is to type the full path to that command. For example, you get the date command from the bin directory by typing: $ /bin/date
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision web and email hosting services

Leave a Reply