Chapter 2 . Running Commands from the Shell (Web hosting india)
Chapter 2 . Running Commands from the Shell 53 If you change directories, the bin name would change to the name of the new directory. Likewise, if you were to log in as a different user or to a different host, that information would change. You can use several special characters (indicated by adding a backslash to a variety of letters) to include different information in your prompt. These can include your terminal number, the date, and the time, as well as other pieces of information. Table 2-7 provides some examples (you can find more on the bash man page): Table 2-7 Characters to Add Information to bash Prompt Special Character Description ! Shows the current command history number. This includes all previous commands stored for your username. # Shows the command number of the current command. This includes only the commands for the active shell. $ Shows the user prompt ($) or root prompt (#), depending on which user you are. W Shows only the current working directory base name. For example, if the current working directory was /var/spool/mail, this value simply appears as mail. [ Precedes a sequence of nonprinting characters. This can be used to add a terminal control sequence into the prompt for such things as changing colors, adding blink effects, or making characters bold. (Your terminal determines the exact sequences available.) ] Follows a sequence of nonprinting characters. \ Shows a backslash. d Displays the day name, month, and day number of the current date. For example: Sat Jan 23. h Shows the host name of the computer running the shell. n Causes a newline to occur. nnn Shows the character that relates to the octal number replacing nnn. s Displays the current shell name. For the bash shell, the value would be bash. t Prints the current time in hours, minutes, and seconds (for example, 10:14:39). u Prints your current username. w Displays the full path to the current working directory.
Note: In case you are looking for affordable and reliable webhost to host and run your business application check Vision php5 hosting services