3 ms·
hah, i had a tool where i configured ~/something as a target directory in its config. except that the tool did not understand ~ and literally created a director
by em-bee 6y ago
hah, i had a tool where i configured ~/something as a target directory in its config. except that the tool did not understand ~ and literally created a directory named '~'
guess what i typed to remove it?
i lost a lot of work that day.
since then i developed the habit to always only use rmdir for directories, and first go into the directory to remove files with rm.
i also avoid rm * by finding some common parts like an extension that most files share.
i don't want rm * to be in my history where i might accidentally call it.
- likeclockwork 6y agoBlender tried this on me a few months ago. I used mv to rename the directory before deleting it though, the fear caught me as soon as I realized I had a directory named ~ sitting in my home directory.
- em-bee 6y agoit tried to blend in ;-) mv is a clever idea. rename to something safe, which can be undone if you get it wrong. i use a similar approach when deleting a lot but not all files from a directory. i first move the files into a new directory, double check that every file is in the right place and then delete the new directory safely.