3

I have several hidden directories in my home directory of which I don't know if I need them any more. How do I know if I can safely delete them?

For instance, next to the directory .gimp-2.8 there is also .gimp-2.4 which dates from two years ago. And it contains more files than the recent one.
Now I could move the old one elsewhere, start up the Gimp and see if it behaves differently, but can I be sure that there are no other applications which make use of these older files?

And there is a very old directory .gnome2_private and I don't even run Gnome, I run KDE. But a quick test shows that when I create a new user on my computer, this directory is created automatically, so it does serve a function, right?

And so on. And there are directories that I don't recognise the name of, so I have no idea to which applications they belong. How can I find out about them?

2 Answers 2

1

If you use your desktop and the relevant application regularly, then use find <dir in question> -atime -90 -ls. If that outputs something, then you know that some file has been used.

Caveat 1: that doesn't work if your home partition is mounted with noatime.

Caveat 2: If find outputs some files, it does not mean that those are really important.

Caveat 3: If find omits some files, it does not mean that those are really useless.

4
  • When I try that, it always shows all the files in the directory, no matter how many days I fill in. Am I doing something wrong?
    – Mr Lister
    Jul 31, 2014 at 15:58
  • That's odd, it works for me. What about -atime 1? should list only a few files. Jul 31, 2014 at 16:01
  • My partition is noatime, so I can't test, but if you access /path/to/foo/bar, will /path/to have its access time modified too? From memory, modified time doesn't work like that.
    – Sparhawk
    Jul 31, 2014 at 17:13
  • no, because if a process calls open() or fopen() or the like on the path, then the kernel will resolve it. But atime/mtime/ctime is set on a filesystem object only if a user process accesses it using the filesystem API. Jul 31, 2014 at 18:36
0

Do you throw away parts from your car when you don't know what they do? No? Then don't do the same thing with your filesystem.

The cost of a file that isn't used is usually negligible, especially compared with the cost of losing a file that's needed. Only consider deleting potentially superfluous files if there is a large number of them (hundreds isn't a large number) or is they're very large (significant proportion of your storage or backup space).

.gimp-2.4 is probably safe to delete if you don't use this Gimp version anymore. It's normal to have some Gnome directories if you don't use Gnome as your window manager (the same goes for KDE and any other GUI toolkit): Gnome is also a GUI toolkit and any application that uses that toolkit might use the .gnome* directories.

If you really really would like to delete a file, rename it and wait a few weeks. If nothing has broken, remove the file (but do make sure you have backups).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .