5 ms·
this is the reason why I always use quotes before specifying folders with rf -rf :)
by dsavinkov 10y ago
this is the reason why I always use quotes before specifying folders with rf -rf :)
- memracom 10y agoI always type ls /stuff/wherever/* Then examine the output to see if that is the stuff I really want to delete and if it is, up-arrow Ctrl-A right right backspace backspace rm -rf enter Never deleted the wrong stuff again in 30 years of doing that
- was_boring 10y agoI always cd to the parent directory, ls with tab complete to check, the rm with the same tab complete.
- okbake 10y agoSomething else that is really useful in these situations (in bash at least) is alt-* (alt-shift-8). It will expand a directory or glob into all effected top level files/directories. For example, it will expand `ls *` to `ls foo bar baz`, etc
- bartvk 10y agoGreat tip, thanks!