Ubuntu / Linux news and application reviews.

Usually if you want to hide a file or folder so it doesn't show up in your file manager, you can rename it by adding a dot (".") at the beginning of the filename.

However, there are situations in which you may want to hide a file or folder without renaming it. For instance, some applications insist on creating a folder in the user's home directory or in the Documents folder (and they can't be renamed) and so on. But I don't want these folders cluttered - I want to easily find what I'm looking for.

Nemo hidden folder

For such situations or whatever other reasons, there's another way of hiding files and folders (prevent them from showing up in the file manager only): you can create a file called ".hidden" (there's a dot in front of "hidden" so this is a hidden file!) and in this file, enter the name of the files and folders you want to hide, each on a separate line. Then, refresh the folder (press F5 or Ctrl + R) and those files or folders should no longer be visible in your file manager.

This should work (at least, it worked in my test) with the following file managers: Nautilus, Nemo, Caja, Thunar (I'm not sure when this was introduced but I can tell you that it doesn't work with version 1.2.2 available in Xubuntu 12.04; it does work with versions 1.6.3 and newer) and Pantheon Files (from Freya only), but there might be others to support it.

Note: for Thunar you'll need to navigate to a separate folder for the changes to be applied, refreshing isn't enough.

Here's an example: let's assume you have a folder called "FOLDER1" and a file call "FILE1" in your home directory and you want to hide both without renaming them. To do this, create a file called ".hidden" in your home directory and in this file, add the following two lines:
FOLDER1
FILE1

Then save the file and press F5 to refresh the home folder - "FOLDER1" and "FILE1" shouldn't be displayed any more.

Extra tip: HERE's a Nautilus extension which allows hiding files and folders using this method via the context menu.