What delete command can be run to remove only files in given directory
Some files don't have extensions so rm *.*
wont work...
There are thousands of files in this folder.
Any advice?
Open the terminal application. To delete everything in a directory run: rm /path/to/dir/* To remove all sub-directories and files: rm -r /path/to/dir/*
dot files. In order to delete the files but keep the sub directories, you could add -type f after the depth option. Also you could add -maxdepth 1 if you want to keep the content of the sub directories.
find PATH -maxdepth 1 -type f -delete
BUT this won't prompt you for confirmation or output what it just deleted. Therefore best to run it without the -delete action first and check that they're the correct files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With