Книга: Fedora™ Unleashed, 2008 edition

Making Directories with mkdir

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/paul and you want to create the directory /home/paul/audio/sound, you get an error like this:

mkdir: cannot create directory `audio/sound`: No such file or directory

At first glance, this seems wrong because 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 previous example, -p creates the parent directories, too. So:

$ mkdir -p audio/sound

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

Оглавление книги


Генерация: 1.375. Запросов К БД/Cache: 3 / 0
поделиться
Вверх Вниз