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

rm -rf /* ?


I believe the spec says arguments can be deleted in any order, so it always chooses "current directory” first, which fails, failing the whole command


No, doesn’t work like that, meaning it should actually delete everything. The shell is expanding /* to the list of paths, not rm, and /* does not expand to / at all.

Try adding “echo “ in front of the rm command line to see how it expands. (That, by the way, is often a good idea.)


Correct.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: