Hide Folders and Show Hidden Files in Ubuntu Linux [Beginner Trick]

You are probably familiar with the concept of “hiding” a folder or file in Windows. Hiding a folder or file just “removes” the folder from the normal view and then you can choose to display “hidden files” to see it.

So how do you see the hidden files in Linux then? Let me show you that.

Show hidden files in Ubuntu & other Linux distributions

If you are in a terminal, you can use the ls command to display the all the files, including the hidden ones:

ls -a

You can recognize the hidden files and folders with the dot (.) before their names.

Show Hidden files in Linux terminal
Files and folders starting with . are hidden from normal view

You can also use the -A option of ls command to show hidden files but without the . and .. files:

ls -A

If you use desktop Linux, you can still see hidden files easily. Let’s see how.

Display hidden files in the file manager (for desktop users)

If you are in the file manager, you can use the Ctrl+H keyboard shortcut in Ubuntu and I presume other distributions to display all the files including the hidden ones.

Pressing Ctrl+H again will hide the files.

If you are not a fan of keyboard shortcuts, you can use the file manager GUI to display the hidden folders and files.

To see a hidden file or hidden folder in Ubuntu, go to the file manager (the default is Nautilus). File Manager is Ubuntu’s counterpart of Windows Explorer.

Now go to the top menu->Show hidden files:

Show hidden files in Ubuntu GNOME desktop
Click on Show Hidden Files to display hidden files and folders

How to hide files or folders in Ubuntu

Now that you have learned to see hidden files in Ubuntu, let’s now see how you can hide files and folders in Linux.

Unfortunately/interestingly, there is no similar way as in Windows to hide a folder. In Windows, you right-click on a file and choose the option of making it hidden. But this option is not available in Ubuntu.

So, how can you hide a folder in Ubuntu then? Very simple! Using the Linux property of hiding a file/folder. In Linux, if a file name starts with . (dot), it is considered a hidden file.

Now if you want to hide a file or folder, let’s say MyFolder, just rename it to .MyFolder and it will be taken as a hidden file or folder.

I hope you know how to rename files in Linux command line using mv command.

mv MyFolder .MyFolder

If you are using Linux desktop, just right click and choose the rename option and add the dot before the name.

Hide Folders Ubuntu Linux
Hide Files and Folders in Linux by adding a dot (.) before their name

Bonus Tip: Hiding multiple files and folders without renaming all of them (valid for GUI only)

This is a neat little trick that will let you hide several files and folders from the normal view in your desktop Linux’s file manager.

Traditionally, if you create a .hidden file and add the name of the folders in this file, those folders will be hidden from normal view when you close your file manager and open it again.

Keep in mind that this trick works with only the current directory you are in. It won’t work for nested directories. You can create the .hidden file in any directory to hide files and folders in it.

This was about hiding files in Linux. There are separate methods for locking a folder in Linux. I hope you like this little bit of Linux knowledge.

Similar Posts

  • How do you unhide folders with illegal names such as colon (:)? Ctrl-H or GUI show hidden files have no effect on these, while Windows 10 at least show the folders even as it denied access to them. This is under EndeavourOS but probably true with most Linux. Thanks.

  • To “hide” data in an NTFS file one can use alternate streams – the default stream is what we normally see and use, but one can simultaneously save data in additional named streams