3 ms·
One time I was debugging the path resolver in a static site generator I was writing. I generated a site ~/foo, thinking it would do /home/shantaram/foo, but ins
by _shantaram 3y ago
One time I was debugging the path resolver in a static site generator I was writing. I generated a site ~/foo, thinking it would do /home/shantaram/foo, but instead it made a dir '~' in the current directory. I did `rm -rf ~` without thinking. Command took super long, wondered what was going on, ctrl-c'd in horror... that was fun.
- xp84 3y agoI’m really curious: without cheating by using the GUI, what would be the proper way to delete such an obnoxiously-named directory? Would “$PWD/~” work?
- r3jjs 3y agoA few ways. rm ./~ is likely the easiest. Another option, shell dependent, would be to turn off shell globbing. The `GNU` version of `find` has a `-maxdepth` option so find . -iname '~' -maxdepth 1 -exec rm {} \; would work, but I don't like relying on `GNU` extensions.
- hddqsb 3y agoOr just: rm "~"