explanation of the convention:
[] : values in square brackets are optional
mkdir [OPTION] DIRECTORY- make a new DIRECTORY
for example this will create a directory games in /home/ishtar/
> cd /home/ishtar > mkdir gamesthis will do exactly the same, but when you're in a different dir.
> cd / > mkdir /home/ishtar/gamesCreating many directories in one go:
> cd /home/ishtar/games ~/games > ls ~/games > ~/games > mkdir mmos puzzle rpg strategy fps ~/games > ls fps mmos puzzle rpg strategyAs you can see this creates only one level of directories, but if you want to create a whole tree then that's possible as well with -p option:
~/games > mkdir -p mmos/screenshots/2015/wow ~/games > ls -R mmos/ mmos/: screenshots mmos/screenshots: 2015 mmos/screenshots/2015: wow mmos/screenshots/2015/wow:as you can see if a directory exists (mmos) it will not get created, and no error will show up, the other directories are created.
No comments:
Post a Comment