Possible Duplicate:
How can I hide directories without changing their names?

I'm using Ubuntu 11.10 and I want to make a file hidden.

How do I make for example a .docx file or a directory hidden?

Please put a way to do it with and without the terminal?


3 Answers 3


Hiding files and directories in Linux is very simple. All you have to do is append a period at the beginning of the name of the file/directory.

With terminal:

mv filename .filename

(This command also works with directories)

Some additional information about the mv command; if the second argument is a directory, the first argument will be moved into that directory, rather than being renamed to it (regardless of whether the first argument was a file or a directory). If the first argument is a directory and the second is a file, you will get an error. If both the first and the second arguments are existing files, the second will be overwritten without prompting you! If you wish to be prompted before overwriting, add -i to the command before either argument

To view hidden files and directories in a terminal, use ls -a.

Without terminal:

Click on the file, press the F2 key and add a period at the beginning of the name. To view hidden files and directories in Nautilus (Ubuntu's default file explorer), press Ctrl+H. The same keys will also re-hide revealed files.

  • If the file have an extension, adding a "~" at the end of the extension name also works. Jan 27, 2018 at 16:16
  • Also for 16.04 you need to refresh the display to update the hidden state. Pressing ctrl-H twice will do. Sep 25, 2018 at 0:18

To make a file or folder hidden, rename it to begin with a dot, for example, .file.docx.

To see the hidden files in Nautilus, hit Ctrl + H, and in the terminal, use ls -a.


You just put a dot at the beginning of a folder or a file.
Nautilus has the option to show this files.

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