HomeComputerLinuxHow to Hide Files and Show Hidden Files on Linux

How to Hide Files and Show Hidden Files on Linux

You might have some personal photos or files on your computer that you want to hide from others. For Windows and Mac users, hiding files is quite easy. But if you are Linux user and thinking about hiding files or folders, it is much easy as well. You can hide files and see already hidden files on your Linux computer in just a few clicks.

Let’s find out the best possible ways to hide sensitive files on your Linux or Ubuntu computer.

Hide Files and Folders in Linux

On Linux, hidden files are simple files with a name that starts with a dot. This is why they’re also often called dot files on Unix. To hide a file on Linux, all you have to do is rename the file.

To hide files, all you need is to add a dot before the name. Depending on your desktop environment, the default files app will be different. But almost every app follows a similar process for renaming files and folders.

how to hide files in linux
  1. Open the Files app on your Linux or Ubuntu PC.
  2. Right-click on the file you want to hide.
  3. Select Rename.
  4. Add a dot before the name. For example, rename file_name as .file_name.

Click anywhere when you’re done and the file will be immediately hidden. You can also click on the file name twice to rename it. Just make sure you don’t double-click but, click two times instead, with some time gap between the clicks.

Related: How to Install Microsoft Teams on Ubuntu and Other Linux Distros

Show Hidden Files on Linux

To see hidden files, you can use the menu options available in your Files app. Again, depending on your desktop environment, the Files app you’re using would be different. That means where they place the option to Show hidden files will also be different.

That said, GNOME and KDE Plasma are the two most popular desktop environments. So we’ll see how to show hidden files in Linux if you’re using either of the two.

GNOME (Nautilus)

GNOME is the default desktop environment on a number of Linux distros, including Ubuntu. And Nautilus is the default file manager on GNOME desktop. To show hidden files in Linux with Nautilus, follow the steps below.

Ubuntu show hidden files
  1. Click on the menu button.
  2. Select Show hidden files.

KDE Plasma (Dolphin)

KDE Plasma is another default DE on a number of different Linux distros. Like GNOME, KDE Plasma has its own framework and design language. It uses Dolphin as the default file manager. Here’s how to show hidden files in Dolphin.

show hidden files in linux (dolphin)
  1. Click on the menu button in the upper-right corner.
  2. Select Show hidden files.

A universal way to show hidden files is to use a keyboard shortcut instead. You can press Ctrl + H on the keyboard to show hidden files on Linux. It works as a toggle, so you can press Ctrl + H again to hide the hidden files too. The keyboard shortcut works across all Linux distros and desktop environments.

files hiddenshow hidden files

Related: How to Install DEB File on Ubuntu and Linux Distros

Hide Files on Linux Without Renaming

Adding a dot is simple, but it can complicate things in some situations. If you want to hide a folder that other programs depend upon, renaming them could spell trouble. For example, the Downloads folder which is where all apps default to when downloading files. If you rename it to .Downloads, programs will create another folder names Downloads when you download something. So, now you have two folders.

The only way to avoid that would be to go into each and every program or app and change the default download location. Similarly, the snap folder, if you have snap installed, is important for snap apps. But here’s a cool trick to hide such important files or folders without renaming them.

.hidden file
  1. Navigate to the folder where the file(s) or folder(s) you want to hide is (are) located.
  2. Right-click an empty space and create a new file named .hidden.
  3. Press Ctrl + H on the keyboard to show hidden files.
  4. Right-click the .hidden file and open it with a text editor.
  5. Type in the name of the file or folder you want to hide.
  6. Save and close the file.
  7. Press Ctrl + H to hide the hidden files again.
Ubuntu hide fileshide files without renaming on linux

The file or folder you typed the name of in the .hidden file should now be hidden. You can hide multiple files or folders with the same file. Just type each name in a new line as shown in the screenshot above.

Keep in mind that the .hidden file needs to be in the same location as the files or folders you want to hide.

Related: How to Hide Apps and Files on Android

You can always hide or retrieve any files ion your Linux computer. Although, these files will be visible if the “Show Hidden Files” option is enabled on the Files app on your computer. Anyone who knows to unhide a file can find your hidden files.

Disclosure: Mashtips is supported by its audience. As an Amazon Associate I earn from qualifying purchases.


Please enter your comment!
Please enter your name here

You May Like

More From Author