What does the command mean? and why is it typed in like that?
Take note that almost all Linux commands follow this syntax structure:
For example, in my sample above I used the “-rf” option. Take note that each letter is a separate option. r for recursive, and f for force.
The command I issued is cp – this means copy.
So, by default, when we copy something, Linux will ask us if we are sure, that we really want to copy the file.
If we are copying all the contents from a directory, and that directory has at least 100 files in it – we need to answer yes 100 times.
When we use an option, we alter the default behavior of the command – we inform it to do additional things.
So, when I issued the f (force) option, this informs my Linux system to not ask me questions for each file that it copies – thereby altering the default behavior of my cp (copy) command.
Linux commands can have a hundred options that you can use, we don’t have to memorize each option. There is a Linux command manual where we can check the available options on the fly. We will discuss how to use this Linux manual later in the course.
some commands are applied on a single target file/directory. When used as a target, we don’t have to specify a <destination>.
There are some commands that creates a new version from an old version of a file/directory.
When I say a new version – this might be a changed content, a changed location, or a changed form of a file/directory.
When this happens, the old version is the source - this can be an absolute or a relative path.
When a command creates a new version of a file/directory, this new version is the destination, this can also be an absolute or a relative path.
Next Topic Suggestion:
Category Suggestion