explanation of the convention:
[] : values in square brackets are optional
rmdir [OPTION] DIRECTORY- remove empty directory/directories
for example this will remove a directory fps from /home/ishtar/games if it is empty
> cd /home/ishtar/games > rmdir fpsthis will do exactly the same, but when you're in a different dir, but it has to be empty, otherwise you will see this.
> cd / > rmdir /home/ishtar/games rmdir: failed to remove ‘/home/ishtar/games/’: Directory not emptyRemoving many empty directories in one go (two ways):
> cd /home/ishtar/games ~/games > ls mmos puzzle rpg strategy ~/games > rmdir mmos puzzle rmdir: failed to remove ‘mmos’: Directory not empty ~/games > ls mmos rpg strategyAs you can see the empty directory has been deleted, but the one which had some content wasn't.
> cd /home/ishtar/games ~/games > rmdir mmos/screenshots/2015/wow/ mmos/screenshots/2015/ mmos/screenshots/ mmos/ ~/games > ls rpg strategyThis will only work if all those directories are empty so to remove them nested that way you will either have to go with the last method above, or to save time use option -p:
~/games > rmdir -p mmos/screenshots/2015/wow ~/games > ls rpg strategyThis is a safe option, because it deletes only directories which are empty.