mkdir
:<strong>mkdir work</strong>
To save time, use one command to create several directories, like this:
pi@raspberrypi ~ $ <strong>mkdir work college games</strong>
pi@raspberrypi ~ $ <strong>ls</strong>
Downloads python_games work college Music Desktop Pictures Documents games Public Templates Videos
You might see additional files here, especially if you followed the earlier examples to make some text files, but the important thing is that one command made three new directories for you.
The mkdir
command’s ability to make several directories at the same time isn’t unusual: Many other commands can also take several arguments and process them in order. You can see the listing of two different directories like this, for example:
<strong>ls ~ /boot</strong>
The mkdir
command doesn’t give you a lot of insight into what it’s doing by default, but you can add the -v
option (short for verbose), which gives you a running commentary as each directory is created. You can see what that looks like in the next code snippet.
-p
option, like this:pi@raspberrypi ~ $ <strong>mkdir –vp work/writing/books</strong>
mkdir : created directory 'work'
mkdir : created directory 'work/writing'
mkdir : created directory 'work/writing/books'
The command keeps you informed of any changes it makes, but if the work
directory already exists, you won’t see the first line of output shown here.