Hide Folders and Show Hidden Files in Ubuntu Linux

Wondering how to see or hide files in Ubuntu Linux? Its damn easy to do so. Here's how to show hidden files in Ubuntu and other Linux distributions.
Warp Terminal

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 Linux terminal

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

ls -a

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

 screenshot of a terminal, listing all the files including hidden ones in a directory. Files and folders starting with . are hidden from normal view
Listing all files in a directory
You can also use the -A option of the ls command to show hidden files but without the . and .. files.

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 also 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 (Ubuntu’s counterpart of Windows Explorer and the default is Nautilus).

Now go to the top-right hamburger menu → Show hidden files:

Click on Show Hidden Files on the top-right hamburger menu to display hidden files and folders
Show Hidden Files

Hide files and 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.

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
Hide files/folders by renaming them using mv command
Hide using mv command

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

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

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.

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

This method works in GNOME's Nautilus file manager. It may or may not work in other file managers.

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 new file named .hidden 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.

Paste the names of files/folders in ".hidden" file to hide them
Hiding Files/folders using .hidden file

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.

Hide it or lock it?

This .hidden file is one of the many lesser-known tweaks of the Nautilus file manager. Here are a few more.

13 Ways to Tweak Nautilus File Manager in Linux
Nautilus, aka GNOME Files, is a good file manager with plenty of features. You can further enhance your experience by using these extensions, tweaks and tips.

This was about hiding files in Linux. There are separate methods for locking a folder in Linux.

How to Password Protect a Folder in Linux
Got some special files to save from prying eyes? Learn how to create password protected folders in the Linux desktop.

I hope you like this little bit of Linux knowledge.

About the author
Abhishek Prakash

Abhishek Prakash

Created It's FOSS 11 years ago to share my Linux adventures. Have a Master's degree in Engineering and years of IT industry experience. Huge fan of Agatha Christie detective mysteries 🕵️‍♂️


Making You a Better Linux User


Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.