Notes

2016-01-05

Because of a misuse of an archiving command I had to delete more than 40,000 files polluting my home directory. The UNIX way should make it easy because the decompression program can output the list of files it extracted. Unfortunately, it turned out to be surprisingly hard for at least two reasons: first 40,000 files is a lot and second, files used funny characters (white-spaces, dashes at the beginning, patheseses, etc.). After some Googling, here is the final command I used, phew.

tr \\n \\0 <list.txt | xargs -0 -n 1 rm -f --