Clean up your files (Linux)

Today I wanted to clean up my computer a bit and decided to finally tackle my files.

Over time, I have accumulated duplicated files and empty folders and it was starting to irritate me to “think” I had saved something (because I saw the folder), only to realise the folder was empty (bad backup over the years, didn’t restore the files within it for example). So I decided to get rid of all duplicate files and empty folders. Here is how I did it :

Delete empty folders

find ~/ -type d -empty -delete

Find duplicate files

fdupes ~/ -r >> duplicate_files.txt or fdupes ~/ -r -d (to get prompted to delete the found files)

Hope this is useful to someone.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s