Answers for "how to remove all the files in a directory in linux"

3

delete all the files without one in linux

# delete all except the filename

$ rm -v !("filename")
Posted by: Guest on August-10-2020
2

ubuntu delete directory and all files

rm -rf ./test
Posted by: Guest on February-01-2021
8

remove all files inside directory linux

# remove everything in a directory 
rm /path/to/dir/*
# remove all sub-directories and files
rm -r /path/to/dir/*
Posted by: Guest on July-10-2020
1

delete all files in linux

Deletes all files in current directory, including hidden

rm -rf {,.[!.],..?}*
Posted by: Guest on September-02-2021
2

remove a file or dir in linux or mac or ubuntu

note:your_file_name can be a dir or a file 

sudo rm -r your_file_name
Posted by: Guest on May-11-2020

Code answers related to "how to remove all the files in a directory in linux"

Python Answers by Framework

Browse Popular Code Answers by Language