4 ms·
The Power of ‘*’ in Linux: A Cautionary Tale of Rm -RF
- deleted 3y ago[deleted]
- bediger4000 3y agoGood article, but why is "rm -rf" capitalized in the HN title line? Is this an instance of a browser or a word processor autocapitalizing?
- chmaynard 3y agoHN messes with the title in various ways when you post something. Not sure if this is documented anywhere.
- NoZebra120vClip 3y agoThe author has overlooked the reality of hidden dotfiles. Using "*" will not necessarily pick up everything in a directory. In the author's case, "rm -rf ." would've been just as destructive, and "rm -rf /" even more so (if the tool itself didn't stop you), so despite the power of the splat, there are many possible footguns. And that's why, if we absolutely, positively want to destroy everything in a folder, we go one level up and call it by name. cd .. && ls -alR myfiles | less rm -rf myfiles Have fun with .git
- simonblack 3y agoThe author has overlooked the reality of hidden dotfiles I learned very early in my UNIX experience two things on the same day: 1) Never do 'normal user' things as root 2) Removing a few dot-directories can be perilous. I thought I'd clean up a bunch of dot-directories in the /tmp filesystem. It was getting a bit full. So I entered the simple command at the '#' prompt. rm -fr .* Wondered why it was taking a while.
- egberts1 3y agorm -rf /bin/laden