Home » Questions » Computers [ Ask a new question ]

What are unnecessary files in Linux and how to clean them up?

What are unnecessary files in Linux and how to clean them up?

On Windows, we have Disk cleanup to clean some files. Other than that, we can search for *.bak or *.tmp files and other unnecessary files and delete them.

Asked by: Guest | Views: 378
Total answers/comments: 2
Guest [Entry]

"This is a potentially dangerous operation. Unless you know what the files are for, you probably shouldn't be removing them. Underneath your home directory, this could be okay, but anywhere else I think you're asking for trouble.

That said, the most common files are going to be editor temporary files. Check your editor's man page for information on what file name or extension it uses for these. Other files may be those which the extension's last character is a ~. For example, filename.mp~ instead of filename.mp3. Various programs and applications may put files in /tmp, but don't remove those unless you know what they're from, because you could end up removing an important file for a running process."
Guest [Entry]

"Any core dumps ('core') more than a few days old can probably go.

Ditto any files called 'a.out' that are more than a few days old.

If you're using an editor that leaves backups around with a '~' tilde at the end, you can probably remove those after a few days too.

For 'few days', consider weekends, holiday weekends, and maybe even vacations. I'd probably not remove anything less than 7 days old, and might well go to 14 or even 21 to allow for longer vacations.

Empirically, though, I don't have any automatic process doing such cleanups."