About -p Option Of Mkdir Command
Hello everyone,
I have read through the Linux man page and also info page of -p option of mkdir command. But I still do not understand what it means, especially missing parent directories. Could anyone show me an example about how to use -p please? thanks in advance, George |
Lets say I want to create a subdirectory called linux in a directory called games. If games doesn't already exist, I can do "mkdir games" and then cd into games and do "mkdir linux". An easier way would be to do "mkdir -p games/linux". This creates games (the parent) as well as a subdirectory called linux at the same time.
|
Example:
Code:
test -d $HOME/test || echo "Not exist" |
Thank you, reddazz!
Quote:
regards, George |
Thanks T.Hsu!
Quote:
regards, George |
All times are GMT -5. The time now is 02:18 AM. |