Hidden files in Linux start with a dot, and revealing them requires just one command. If you are new to Linux, you might wonder how to see hidden files in linux without getting lost in the terminal. This guide will show you the simplest ways, from the command line to the file manager, so you can manage those dot files with confidence.
Hidden files are not secret or dangerous. They are just configuration files that stay out of sight to keep your home folder clean. Knowing how to see hidden files in linux helps you edit settings, fix problems, or just understand your system better.
Let’s start with the basics and then move to more advanced methods. By the end, you will be able to reveal hidden files in any Linux distribution.
What Are Hidden Files In Linux
In Linux, a hidden file is any file or folder whose name begins with a dot (.). For example, .bashrc, .gitconfig, and .ssh are common hidden files. The system does not show them by default in directory listings or file managers.
Why hide them? Mostly to reduce clutter. Configuration files are important but you do not need to see them every time you list files. Hiding them keeps the view clean while still allowing access when needed.
Hidden files are not protected. They have the same permissions as regular files. Anyone with read access can view them if they know the right command. So hiding is about convenience, not security.
How To See Hidden Files In Linux Using The Command Line
The terminal is the fastest way to reveal hidden files. The ls command lists files, and adding the -a flag shows all files including hidden ones.
Basic Ls Command With -A Flag
Open your terminal. Type this command and press Enter:
ls -a
This will list every file and folder in the current directory, including the dot files. You will see entries like . (current directory) and .. (parent directory). If you want to skip those two special entries, use the -A flag instead:
ls -A
The -A flag shows all hidden files except . and ... This is often cleaner for everyday use.
Using Ls With Long Format
To see more details like permissions, size, and modification date, combine flags:
ls -la
Or without the dot entries:
ls -lA
The -l flag gives a long listing format. This is helpful when you need to check file permissions or ownership of hidden files.
List Hidden Files In A Specific Directory
You can target any folder. For example, to see hidden files in your home directory:
ls -la ~
Or in the /etc directory:
ls -la /etc
This works for any path. Just replace the directory with the one you want.
Recursive Listing Of Hidden Files
If you want to see hidden files inside subdirectories too, use the -R flag:
ls -laR
This will list all files recursively, including hidden ones in every subfolder. Be careful with large directories as the output can be long.
How To See Hidden Files In Linux Using File Managers
If you prefer a graphical interface, most Linux file managers have a keyboard shortcut to toggle hidden files.
Nautilus (Gnome Files)
Nautilus is the default file manager on Ubuntu, Fedora, and many other distributions. To show hidden files:
- Press Ctrl + H on your keyboard.
- Or click the hamburger menu (three horizontal lines) and select Show Hidden Files.
Pressing Ctrl+H again hides them. This toggle works instantly.
Dolphin (Kde Plasma)
Dolphin is the file manager for KDE. Use one of these methods:
- Press Alt + . (dot key).
- Or go to View > Show Hidden Files from the menu bar.
The shortcut Alt + . is quick and easy to remember.
Thunar (Xfce)
Thunar is lightweight and common on Xfce desktops. To see hidden files:
- Press Ctrl + H.
- Or click View > Show Hidden Files.
Same shortcut as Nautilus, so it is consistent across many environments.
Pcmanfm (Lxde)
PCManFM is used on LXDE and LXQt. The shortcut is also Ctrl + H. You can also find the option under the View menu.
Caja (MATE)
Caja is the file manager for MATE desktop. Press Ctrl + H or go to View > Show Hidden Files.
Most file managers follow the same pattern. If yours is different, check the View menu for a toggle option.
How To See Hidden Files In Linux Permanently
Maybe you want hidden files to always be visible. You can change the default behavior in your file manager settings.
In Nautilus
Open Nautilus. Click the hamburger menu and select Preferences. Go to the Views tab. Check the box that says Show hidden and backup files. Now hidden files will always appear.
In Dolphin
Open Dolphin. Go to Settings > Configure Dolphin. Under General > Behavior, check Show hidden files. Click Apply.
In Thunar
Open Thunar. Go to Edit > Preferences. In the General tab, check Show hidden files. This setting is persistent.
For the command line, you cannot make ls show hidden files by default without using an alias. Add this line to your .bashrc or .zshrc file:
alias lsa='ls -a'
Then reload with source ~/.bashrc. Now typing lsa will always show hidden files.
How To See Hidden Files In Linux Using Wildcards
Sometimes you only want to see hidden files, not all files. You can use a wildcard pattern with ls.
List Only Hidden Files
Use this command to show only files starting with a dot:
ls -d .*
The -d flag prevents listing the contents of directories. The pattern .* matches any file or folder starting with a dot. This will list only hidden items.
If you want to exclude . and .., use:
ls -d .[!.]*
This pattern matches dot files that are followed by a non-dot character. It is a bit more complex but useful for scripts.
Using Find Command
The find command can also locate hidden files. For example, to find all hidden files in the current directory:
find . -maxdepth 1 -name ".*"
The -maxdepth 1 limits the search to the current directory only. Remove it to search recursively.
How To See Hidden Files In Linux With Tree Command
The tree command shows a visual directory tree. To include hidden files, use the -a flag:
tree -a
This will display all files and folders, including hidden ones, in a tree structure. It is great for understanding the layout of a directory.
If tree is not installed, you can install it with your package manager. On Debian/Ubuntu:
sudo apt install tree
On Fedora:
sudo dnf install tree
How To See Hidden Files In Linux Using Grep
You can combine ls with grep to filter for hidden files. For example:
ls -la | grep "^\."
The ^\. pattern matches lines that start with a dot. This will show only hidden files from the long listing.
This method is useful when you want to search for specific hidden files or patterns.
How To See Hidden Files In Linux With Midnight Commander
Midnight Commander (mc) is a text-based file manager. To show hidden files:
- Press Ctrl + H while in the panel.
- Or press F9 to open the menu, then go to Command > Show hidden files.
Midnight Commander is useful over SSH or in a terminal without a GUI.
How To See Hidden Files In Linux With Bash Shortcuts
You can create aliases to make viewing hidden files faster. Add these to your .bashrc:
alias lh='ls -la'
alias l.='ls -d .*'
Then reload with source ~/.bashrc. Now lh shows all files with details, and l. shows only hidden files.
These shortcuts save time if you frequently check hidden files.
How To See Hidden Files In Linux With Zsh
If you use Zsh (common with Oh My Zsh), the ls commands work the same. But Zsh has some extra features. For example, you can use globbing to match hidden files:
ls -la *(D)
The (D) glob qualifier includes dot files. This is Zsh-specific and very powerful for advanced users.
How To See Hidden Files In Linux With Gui Tools
Besides file managers, there are other graphical tools that can show hidden files.
Using The Terminal Emulator
Most terminal emulators like GNOME Terminal, Konsole, or Xterm do not have a setting for hidden files. The command line is the way to go.
Using A File Search Tool
Tools like Catfish or KFind can search for hidden files. In Catfish, you can enable Show hidden files in the preferences. Then search for any file pattern.
Common Mistakes When Trying To See Hidden Files
Here are some pitfalls to avoid:
- Forgetting the
-aflag:lsalone does not show hidden files. - Using
ls .*without-d: This will list the contents of hidden directories. - Thinking hidden files are secure: They are not. Anyone with terminal access can see them.
- Confusing hidden files with system files: Hidden does not mean protected. System files in
/etcare not hidden by name.
How To See Hidden Files In Linux On Remote Servers
When you SSH into a server, you are in a terminal. The same ls -a command works. There is no GUI, so the command line is your only option.
If you use a tool like WinSCP or FileZilla, they have options to show hidden files. In WinSCP, go to View > Show Hidden Files. In FileZilla, go to Server > Force showing hidden files.
How To See Hidden Files In Linux With Python Or Scripts
If you write scripts, you can list hidden files programmatically. In Python:
import os
files = [f for f in os.listdir('.') if f.startswith('.')]
print(files)
This will print a list of hidden files in the current directory. Useful for automation.
Frequently Asked Questions
What Is The Command To See Hidden Files In Linux?
The command is ls -a or ls -A. The -a flag shows all files including . and .., while -A excludes them.
How Do I Show Hidden Files In Ubuntu File Manager?
Press Ctrl + H in Nautilus (Files). This toggles hidden files on and off.
Are Hidden Files Visible To Other Users?
Yes, if the other user has read permissions. Hidden files are not encrypted or protected by default.
Can I Make Hidden Files Always Visible In Terminal?
Not directly, but you can create an alias like alias ls='ls -a' in your shell config file. Be careful because this changes the default behavior.
How To See Hidden Files In Linux Without Terminal?
Use your file manager’s shortcut (usually Ctrl+H) or enable the option in preferences.
Conclusion
Now you know how to see hidden files in linux using both the command line and graphical tools. The ls -a command is the quickest way, but file manager shortcuts are great for everyday use. Remember that hidden files are just regular files with a dot prefix. They are not secret or dangerous.
Practice these commands and shortcuts. Soon you will navigate hidden files with ease. Whether you are editing config files or just exploring, this skill is essential for any Linux user.
If you run into any issues, double-check your syntax. The commands are simple but easy to mistype. Keep this guide bookmarked for quick reference.