How Do I Truncate a Folder in Linux?
Contents How Do I Truncate a Directory in Linux? How Do I Empty a Directory (Delete All Files) Under Linux / Unix Without Deleting Directory Itself? …Delete...
Contents
How do I truncate a directory in Linux?
How do I empty a directory (delete all files) under Linux / Unix without deleting directory itself?
…
Delete All Files Using the Find Command
- -type f : Delete on files only.
- -type d : Remove folders only.
- -delete : Delete all files from given directory name.
Must Read
How do I truncate a folder?
To remove a directory and all its contents, including any subdirectories and files, use the rm command with the recursive option, -r . Directories that are removed with the rmdir command cannot be recovered, nor can directories and their contents removed with the rm -r command.