Hello, and welcome to the next in a series of videos discussing how to use the Linux operating system. These videos have been designed to assist you in learning the basics of how to use the Linux operating system.
In this video, we will take a look at the different types of Linux commands. This knowledge is going to be important for understanding how we run those commands and how we change the commands through the use of options and arguments.
There are four different types of commands that you can use with the Linux Operating system.
Executable programs will be, by far, the most common type of command. These are programs that live in the /usr/bin directory and, when run, produce output to a file or to the console.
The remaining three command types – shell builtin, shell function, and shell alias – are all provided by the Linux shell. Builtins are provided by, and programmed into, the shell. These include commands like ‘cd’ and ‘alias’. Functions are a type of user-defined builtin command, meaning that functions can be user
defined and then run like an executable program. Aliases are just a type of command substitution.
A command is made up of three different parts:
2.Some number of options (which are optional)
3.Some number of arguments
Any specified options will modify the behavior of the command in some way. In our next module, we will discuss how to determine the function of these options.
Arguments that are specified on the command line are typically files, directories, or some other data on which the command acts. These are often optional, as well.
As an example, let’s look at the widely-used ls command. We will be discussing this command in far more detail soon, but for now, it is enough to know that the ls command will display a listing of files and folders.
If we add the –l option, then we will be provided with a ‘long-listing’ of the options, which provides a lot more information.
When we use the ls command without any arguments, we are presented with a listing of the files and folders in the current directory. If we type in an argument of /home after the command, we can see the files and folders within the specified directory, in this case, the /home directory.
We can even combine all of these commands together and get a long-listing of the contents of the /home directory.
As you can probably guess, for our example:
ls is our command
-l is our option
/home is our argument
Each option and argument provides some way to alter the behavior of our command in order to provide us with different views of the information we request.
Options are typically… optional. Commands usually function without them, as well as with them. They will change the default behavior of the program, as mentioned previously.
Also, some options may have long and short versions. A short option is prefixed with a single dash. Long options are prefixed with two dashes, and may include several words – each of which may be separated by more dashes.
Arguments may be required for some commands, but are usually optional and only affect the command by providing additional context for the command to parse.
Often this is going to be a file name, or a directory name. It may also be some other information or data provided
Commands are the most common form of process that are run on a Linux system. You should now have a working knowledge of commands, options, arguments and how to structure those to make them work in a Linux system.
We also learned how: 1.options change the default behavior of the program
a.how it runs, or b.what it outputs; and
2.arguments typically provide context, such as a file or directory path, to a command In our next video, we will be discussing the methods of obtaining help when using a Linux system.
We recommend that you understand the material presented here before continuing with the next videos. See you next time.