![]() Deleting a Folder and all its contents with rm -rf That could get real tedious if you have multiple levels of directories with multiple files in each. ![]() Okay, so you can delete directories with the rmdir command, but only if they're empty. This time, when I press Enter, the directory is deleted, and we can verify that it's gone with the "ls" command. The command I'll use is this: "rmdir TextFiles/" The "TextFiles" directory is empty, so if I try to delete it with the "rmdir" command it will work. This time, the message we get is "rmdir: AlsoImportant/: Directory not empty" which at least tells us that the directory is not empty. The command I'll try is this: "rmdir AlsoImportant/" So, if I try to delete the "AlsoImportant" directory with "rmdir" I'll get an error. This however, will only work if the directory is empty. There is a command "rmdir" (for re move directory) that is designed to remove (or delete) directories. This doesn't actually tell you that it failed, but if we type "ls" we'll see that the directory is still there. When I press Enter, I get the message "rm: AlsoImportant/: is a directory". The command I'll try is this: "rm AlsoImportant/" To demonstrate, I'll try to delete the "AlsoImportant" directory with the "rm" command. Deleting Empty Folders with rmdirÄeleting directories is also a little different from the way you delete files. This video shows how to delete folders whether or not they contain other folders and files. Deleting folders differs from deleting files because there may be any number of files inside the directory. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |