In Linux, the filesystem contains thousands of files that you rarely need to interact with during normal operation—configuration files, user profile settings, application caches, and system directories. To prevent your workspace from becoming cluttered, Linux hides these files by default. However, when you need to modify an application’s configuration, troubleshoot a user profile, or manage SSH keys, knowing how to reveal and manipulate these hidden files is essential.
How Hidden Files Work in Linux
Unlike Windows, which relies on a specific file attribute setting to hide files, Linux uses a much simpler naming convention. Any file or directory that begins with a period (a “dot”) is automatically hidden from standard directory listings.
For example, a file named .bashrc or a directory named .ssh will not appear when you open your file manager or run a standard terminal command. Because of this convention, hidden files are frequently referred to as “dotfiles” by the Linux community.
Method 1: Showing Hidden Files in the Terminal
If you are working via the command line or managing a remote server via SSH, the standard ls (list) command will ignore dotfiles. You must append a specific flag to reveal them.
- Open your terminal application.
- Navigate to the directory you want to inspect. (User configuration files are almost always stored in your Home directory, accessible by typing
cd ~). - Type the following command:
ls -a - Press Enter.
The -a flag stands for “all.” Your terminal will output a list of every file in the directory, including those beginning with a dot. You will often see . (representing the current directory) and .. (representing the parent directory) alongside your hidden files.
For a more detailed view that includes file permissions and sizes, combine the flags: ls -la.
Method 2: Showing Hidden Files in the GUI File Manager
If you are using a desktop Linux distribution (like Ubuntu, Fedora, or Linux Mint), you likely manage files using a graphical user interface (GUI) file manager such as Nautilus, Dolphin, or Thunar.
To reveal hidden files in almost any Linux graphical file manager, use the universal keyboard shortcut:
Press Ctrl + H
The file manager will instantly reveal all hidden folders and files in the current window. They often appear slightly faded or translucent to differentiate them from standard files. To hide them again, simply press Ctrl + H a second time.
Alternatively, you can usually find the option in the file manager’s menus by clicking the “View” or “Options” hamburger menu and checking the box for “Show Hidden Files.”
Troubleshooting Common Mistakes
When working with hidden files, exercise caution:
- Accidental Deletion: Dotfiles contain the configuration settings for your desktop environment and applications. Deleting a directory like
.configor.localcan reset your entire desktop to its factory defaults and cause applications to break. Never delete a hidden file unless you know exactly what it controls. - Creating Hidden Files: If you want to hide a file yourself, you do not need special permissions. Simply rename the file using the
mvcommand to add a dot at the beginning:mv secret.txt .secret.txt.
By understanding how to toggle the visibility of dotfiles, you gain access to the deeper configuration layers of your Linux system.