Before we take a look into some commands, let's take a formal look at how they are structured.
There are three main components that go into a command.
When entering a command, order matters. It's important to place the command name first - otherwise, the shell won't know how to process your submission.
Most commands come with certain options, which modify how the command is run. To apply an option, trail it immediately after your command with a hyphen (-).
There is also a long option form of each short option that uses two hyphens (--). We'll stick to the short option for the sake of brevity.
$ command -shortOptions $ command --longOptions
Note that some commands that we'll discuss in the future have actions instead of options. For example, when we later learn about package management, we'll see that some commands use actions words (eg.
apt-get install packagename.deb instead of options.
An argument is some information you pass to the command when it is started.
$ command -options arguments
You may have multiple options and arguments, as we'll discuss real soon.
We can use the
type command to see how our shell interprets our command.
One of the many possibile ways that the shell may interpret a command is as a shell builtin. This means that the command is called from the shell and directly executed in the shell itself.
$ type type
type is a shell builtin
Commands may also be loaded and run from an external file.
$ type ls
ls is hashed (/bin/ls)
Another way a command can be referenced is through user-defined aliasing. In the example below, we aliased
db to guide us to our Dropbox directory. We'll learn how to implement an alias real soon.
$ type db
db is aliased to `cd ~/Dropbox'
To comment in the shell, use the pound (
#) symbol. Anything after
# will be ignored.
Relieve spasms, tight muscles, trigger points and pressure points with the Body Back Buddy! This trigger point massage is designed to help you self-message any area of your body - especially those that are hard to reach. Keeping your muscles relaxes and out of contraction is importan in helping to reduce pain and prevent muscle injury.$ Check price
This book approaches system administration in a practical way and is an invaluable reference for both new administrators and experienced professionals. It details best practices for every facet of system administration, including storage management, network design and administration, email, web hosting, scripting, and much more.$ Check price