- A command line is a text-based interface which can be used to input instructions to a computer system.
- The Linux command line is provided by a program called the shell. Various options for the shell program have been developed over the years and different users can be configured to use difference shells. Most users, however, stick with the current default shell.
- The default shell for users in RHEL/CentOS is the GNU Bourne-Again shell (BASH). Bash is an improved version of one of the most successful shells used on UNIX-like systems, the Bourne Shell (sh).
- When a shell is used interactively, it display a string when it is waiting for a command from the user. This is called the shell prompt.
- When a regular user starts s shell, the default prompt ends with a $ character, as shown below
[myname@servername ~] $
- The $ character is replaced by a # character if the shell is running as the superuser, root. This makes it more obvious that it is a superuser shell, which helps to avoid accidents and mistakes which can affect the whole system. The superuser shell prompt is shown as below.
[myname@servername ~] #
- Using bash to execute commands can be powerful. The bash shell provides a scripting language that can simply or make possible operations that are hard to accomplish efficiently with graphical tools.
Commands entered at the shell prompt have tree basic parts:
- Command to run
- Options to adjust the behavior of the commands
- Arguments, which are typically targets of the commands
Options normally start with one or two dashes (-a or --all) to distinguish them from arguments.
Commands may also be followed by one or more arguments, which often indicates a target that the command should operate upon.