Bash shell executes the content of the PROMPT_COMMAND just before displaying the PS1 variable.
[continue reading…]
The PS4 shell variable defines the prompt that gets displayed, when you execute a shell script in debug mode as shown below.
[continue reading…]
You can define a custom prompt for the select loop inside a shell script, using the PS3 environment variable, as explained below.
[continue reading…]
A very long command can be broken down to multiple lines by giving \ at the end of the line. The default interactive prompt for a multi-line command is “> “. Let us change this default behavior to display “continue->” by using PS2 environment variable as shown below.
The default interactive prompt on your Linux can be modified as shown below to something useful and informative. In the following example, the default PS1 was “\s-\v\$”, which displays the shell name and the version number. Let us change this default behavior to display the username, hostname and current working directory name as shown below.
[continue reading…]
Ac command will display the statistics about the user’s connect time.
[continue reading…]
diff command compares two different files and reports the difference. The output is very cryptic and not straight forward to read.
[continue reading…]
Stat command can be used either to check the status/properties of a single file or the filesystem.
[continue reading…]
Cut command can be used to display only specific columns from a text file or other command outputs.
Following are some of the examples.
[continue reading…]
Uniq command is mostly used in combination with sort command, as uniq removes duplicates only from a sorted file. i.e In order for uniq to work, all the duplicate entries should be in the adjacent lines. Following are some common examples.
[continue reading…]