1.1. Command Line Basics¶
1.1.1. What’s A CLI?¶
A Command Line Interface or CLI is a simple text only interface. A user provides a command with or without some additional information and then the command is executed.
Basics:
1. When you execute a command you must type the name of the command. In addition
the command must be located in your PATH
.
What’s a
PATH
? APATH
is a list of directories where executables will be located. Common directories inPATH
are/bin/
and/usr/bin/
.
2. When you execute a command, you often will need to provide additional information in the form of arguments.
Common arguments
Meanings
-h
displays help information
-v
increases information output, v is for verbosity
--version
displays version information
Below is an example of running
file -h![]()
Figure 1.2.1: The argument -h is often used to display basic help information¶
If you can not get enough information from the -h argument you can make use of the
man
(for manual) command (*). Theman
command takes the name of a command as an argument and brings up its manual page. This contains a more in depth explanation of the command and its usage.Below is an example of running
man ls
Figure 1.2.2: The
man
command is extremely useful for learning about the syntax/usage of a command¶
Further reading:
This was a very brief introduction to the terminal. It was included only to give some context to further chapters that make use of arguments. For more information feel free to check this resource.
- *
The man command should be available in any GNU-style terminal. If you are using Windows the native Command Prompt does not have a
man
command.