Ubuntu Unleashed 2019 Edition: Covering 18.04, 18.10, 19.04

(singke) #1
whereis command—Returns the location    of  command (for    example,
/bin, /sbin, or /usr/bin/command) and its man page, which is an
entry for the command included as a file already on your computer in a
standardized manual format.
whatis command—Returns a one-line synopsis from command’s man
page.
type name—Returns how a name would be interpreted if used as a
command. This generally shows options or the location of the binary that
will be used. For example, type ls returns ls is aliased to
‘ls –color=auto’.

Making Directories with mkdir


Making directories is as easy as it sounds, although there is one parameter
you should be aware of: -p. If you are in /home/matthew and you want to
create the directory /home/matthew/audio/sound, you get an error
like this:


Click here to view code image
mkdir: cannot create directory 'audio/sound': No such file or
directory


At first glance, this seems wrong; mkdir cannot create the directory because
it does not exist. What it actually means is that it cannot create the directory
sound because the directory audio does not exist. This is where the -p
parameter comes in: If you try to make a directory within another directory
that does not exist, as in the preceding example, -p creates the parent
directories, too, if you use it like this:


Click here to view code image
matthew@seymour:~$ mkdir -p audio/sound


This first creates the audio directory and then creates the sound directory
inside it.


Moving Files with mv


The mv command is one of the easiest around. There are two helpful
parameters to mv: -f, which overwrites files without asking; and -u, which
moves the source file only if it is newer than the destination file. That’s it.
You can use absolute paths to indicate the destination directory (starting from

Free download pdf