← Back to context

Comment by simonblack

4 years ago

A couple of weeks after moving to UNIX from MSDOS, I thought I'd remove lots of unnecessary 'dot-directories' from the /tmp directory. I was root as I had no concept of being a 'normal user'.

So I ran two simple commands:

     cd /tmp
     rm -fr .*

and wondered why it was taking so long. <grin>

At least that doesn't happen today anymore. From bash:

> When a pattern is used for pathname expansion, the character ``.'' at the start of a name or immediately following a slash must be matched explicitly, unless the shell option dotglob is set. The filenames ``.'' and ``..'' must always be matched explicitly, even if dotglob is set.

I did that on my NAS a few years ago. I had copied in a bunch of directories from a mac and they all had tons of dot files in each dir that were showing up on my windows machines. I popped open a terminal and did the exact same thing and wiped most of the NAS out =P Good thing I had it mirrored with my other synology.