Bash shell executes the content of the PROMPT_COMMAND just before displaying the PS1 variable.
[click to continue…]
The PS4 shell variable defines the prompt that gets displayed, when you execute a shell script in debug mode as shown below.
[click to continue…]
You can define a custom prompt for the select loop inside a shell script, using the PS3 environment variable, as explained below.
[click to continue…]
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.
[click to continue…]
Ac command will display the statistics about the user’s connect time.
[click to continue…]
diff command compares two different files and reports the difference. The output is very cryptic and not straight forward to read.
[click to continue…]
Stat command can be used either to check the status/properties of a single file or the filesystem.
[click to continue…]
Cut command can be used to display only specific columns from a text file or other command outputs.
Following are some of the examples.
[click to continue…]
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.
[click to continue…]