How to write Command to erase all files in the current directory, including all its sub-directories, using only one command?
hefaz
3
Hanif Hefaz
Recommended Answers
Jump to PostI would say
rm -rf *
.
Jump to PostHi,
you can use
rm -rdf *
it will remove all files and directories recursively. For more information about the options read the manual:man rm
and be careful, always check current path, as it can hurt.
Jump to PostBy erasing them from bash_history, but if you want to delete a folder called "myFolder" and everything in it, just use sudo
rm -rf myFolder
then even if you recall the command later on, it will just give an error that the folder was not found
All 10 Replies
Gribouillis
1,391
Programming Explorer
Team Colleague
cereal
1,524
Nearly a Senior Poster
Featured Poster
hefaz
3
Hanif Hefaz
hefaz
3
Hanif Hefaz
cereal
1,524
Nearly a Senior Poster
Featured Poster
Gribouillis
1,391
Programming Explorer
Team Colleague
cereal
commented:
+1
+13
hefaz
3
Hanif Hefaz
Slavi
94
Master Poster
Featured Poster
hefaz
commented:
Thanks!
+2
Gribouillis
1,391
Programming Explorer
Team Colleague
hefaz
3
Hanif Hefaz
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.