Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What would be the "good" alternative ? I often tries "rmdir" or "rm -r" if the directory is not empty and very often there are some "protected files" so I add -f. Thus it happens that I directly lauch "rm -rf".


Watch it fail first, verify that the failure makes sense, check to see if there's a way to delete one file with -f before deleting the rest with -r. Use -rf only as a last resort, and only by appending the f to an already-failed command whose syntax you've validated.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: