You Asked: How Do I Empty a Folder in Ubuntu?
Contents How Do I Delete Files and Folders in Ubuntu Terminal? How to Remove Directories (Folders) to Remove an Empty Directory, Use Either Rmdir or Rm -D...
Contents
How do I delete files and folders in Ubuntu terminal?
How to Remove Directories (Folders)
- To remove an empty directory, use either rmdir or rm -d followed by the directory name: rm -d dirname rmdir dirname.
- To remove non-empty directories and all the files within them, use the rm command with the -r (recursive) option: rm -r dirname.
1 сент. 2019 г.
Must Read
How do I empty a folder in Linux?
To delete an empty directory, use the -d ( –dir ) option and to delete a non-empty directory, and all of its contents use the -r ( –recursive or -R ) option. The -i option tells rm to prompt you to confirm the deletion of each subdirectory and file.