December 2012
Intermediate to advanced
888 pages
48h 24m
English
To delete an empty directory named directoryname, use the following command:
matthew@seymour:~$ rmdir directoryname
You can remove a directory in a different location by changing what is after rmdir. To remove a directory in /home/matthew/music, if I am already in my /home directory, I can use the following:
matthew@seymour:~$ rmdir music/directoryname
Or from anywhere using an absolute path, I can use this:
matthew@seymour:~$ rmdir /home/matthew/music/directoryname
Or from anywhere using a path shortcut, I can use the following command:
matthew@seymour:~$ rmdir ~/music/directoryname
The directory must be empty to be removed using rmdir. However, there is a way to remove a directory with its contents using rm
Read now
Unlock full access