CLI Quirks

The command line interface usually has some general features to aid the average user. It is considered to be much more versatile than a graphical interface.

-h and -v

Commands usually have a -h and a -v option. -h displays the help for the command, and -v displays the version of the utility. However, -v can also usually be used to toggle verbosity.

Options can also be combined in some, like bc where you can use bc -lq.

Linux Control Operators

Piping

Commands can be used in conjunction with other commands. Output redirecting to the input of another command is known as piping. An example is lolcat, which can read text and output it with different colors.

cat file | lolcat

Output management

The greater than symbol can be used to redirect output. - > overwrites the file. - >> appends the output to the file.

Shebangs

#! followed by a path makes the shell use the specified interpreter, when the file is used as an executable.

Page added on 2021-10-25, last edited on: 2021-12-08


homepage

All site content is in the Public Domain.