How To Display Hidden Files In Linux : Show Hidden Files In Linux Directory

Hidden files in Linux start with a dot, and you can show them using the ls -a command. If you are wondering how to display hidden files in linux, this guide covers every method you need, from the terminal to file managers. These files store configuration settings and system data, and knowing how to see them is essential for system administration and troubleshooting.

Linux hides files that begin with a dot (.) to keep your home directory clean. But when you need to edit a config file or debug an application, you must reveal them. This article walks you through the terminal, GUI file managers, and advanced commands.

What Are Hidden Files In Linux

Hidden files in Linux are regular files or directories whose names start with a dot. The system does not show them by default in directory listings or file managers. Examples include .bashrc, .profile, and .gitignore.

They are not secret or encrypted—just hidden to reduce clutter. Most user-specific configurations live in hidden files inside your home folder.

How To Display Hidden Files In Linux Using The Terminal

The terminal is the most direct way. You have several commands to choose from, each with its own strengths.

Using The Ls Command With The -A Flag

The ls -a command lists all files, including hidden ones. The -a flag stands for “all.”

  1. Open a terminal window.
  2. Type ls -a and press Enter.
  3. You will see files starting with a dot, such as ., .., .bashrc.

The output includes . (current directory) and .. (parent directory). If you want to exclude these, use ls -A (capital A) instead.

Using The Ls Command With The -Al Flag

For a detailed view, combine flags. ls -al shows all files with permissions, owner, size, and modification date.

ls -al

This is the most common way to inspect hidden files in a directory. The output is long but informative.

Using The Ls Command With The -LA Flag

If you want all files except . and .., use ls -lA. This is cleaner for scripting or quick checks.

ls -lA

Using The Find Command To Locate Hidden Files

The find command can search for hidden files recursively. For example, to find all hidden files in your home directory:

find ~ -name ".*" -type f

This lists every file starting with a dot. You can modify the path or add options like -maxdepth to limit depth.

Using The Tree Command To Visualize Hidden Directories

The tree command shows directory structures. To include hidden files, use the -a flag:

tree -a

If you want to hide . and .., add --dirsfirst or pipe to grep.

How To Display Hidden Files In Linux Using File Managers

Graphical file managers also let you toggle hidden files. Here are the most common ones.

Nautilus (Gnome Files)

Nautilus is the default file manager in GNOME. To show hidden files:

  • Press Ctrl + H to toggle visibility.
  • Alternatively, go to the menu (three lines) and select Show Hidden Files.

This works instantly and applies to the current window only.

Dolphin (KDE)

In Dolphin, press Alt + . (period) to toggle hidden files. You can also click the View menu and check Show Hidden Files.

Thunar (XFCE)

Thunar uses Ctrl + H as well. Or go to View > Show Hidden Files.

Nemo (Cinnamon)

Nemo also uses Ctrl + H. You can also click the View menu and select Show Hidden Files.

PCManFM (LXDE)

PCManFM uses Ctrl + H to toggle. The menu option is under View > Show Hidden.

How To Display Hidden Files In Linux Permanently

If you always want to see hidden files in the terminal, you can set an alias. Add this line to your .bashrc or .bash_aliases file:

alias lsa='ls -a'

Then reload the file:

source ~/.bashrc

Now typing lsa will show all files. You can also create aliases like l for ls -al.

For file managers, you can set the default view to show hidden files. In Nautilus, go to Preferences > Views and check Show hidden files. This setting persists across sessions.

How To Display Hidden Files In Linux Using Wildcards

You can use shell wildcards to list hidden files specifically. For example:

ls .*

This lists all files starting with a dot. But it also includes . and ... To avoid that, use:

ls .[!.]*

This pattern matches any file starting with a dot followed by a character that is not a dot. It excludes . and ...

Another option is:

ls .??*

This matches files with at least two characters after the dot, which also skips . and ...

How To Display Hidden Files In Linux With Grep

If you want to filter output from ls or other commands, use grep. For example, to list only hidden files in the current directory:

ls -a | grep "^\."

This pipes the output to grep and shows lines starting with a dot. You can combine this with other flags for more control.

How To Display Hidden Files In Linux Recursively

To see hidden files in subdirectories, use the -R flag with ls:

ls -aR

This lists all files recursively, including hidden ones. The output can be long, so you might want to pipe it to less:

ls -aR | less

For a cleaner view, use tree -a or find as described earlier.

How To Display Hidden Files In Linux For A Specific Directory

You can specify a path with any command. For example, to see hidden files in /etc:

ls -a /etc

Or to find hidden files in /var:

find /var -name ".*" -type f

This is useful for system administration tasks.

How To Display Hidden Files In Linux Using Scripts

You can write a simple script to list hidden files. Create a file called showhidden.sh:

#!/bin/bash
ls -a | grep "^\."

Make it executable:

chmod +x showhidden.sh

Run it with ./showhidden.sh. You can expand the script to accept a directory argument.

How To Display Hidden Files In Linux On Remote Servers

When connected via SSH, the same commands work. Just log in and use ls -a or find. There is no difference between local and remote sessions.

If you use a tool like WinSCP or FileZilla, you can enable “Show hidden files” in the view settings.

How To Display Hidden Files In Linux With Different File Managers

Here is a quick reference for common file managers:

  • Nautilus: Ctrl + H
  • Dolphin: Alt + .
  • Thunar: Ctrl + H
  • Nemo: Ctrl + H
  • PCManFM: Ctrl + H
  • Midnight Commander: Press Ctrl + H to toggle

Most file managers follow the same shortcut. If unsure, check the View menu.

Common Mistakes When Displaying Hidden Files

New users often confuse ls -a with ls -A. The former includes . and .., which can clutter output. Use ls -A for a cleaner list.

Another mistake is forgetting that hidden files are not secret. They are just hidden from default views. Permissions still apply.

Also, do not delete hidden files without understanding their purpose. Files like .bashrc control your shell environment.

How To Display Hidden Files In Linux For System Directories

System directories like /etc and /var also contain hidden files. Use the same commands with appropriate paths. For example:

ls -a /etc

You may need sudo to view files in protected directories:

sudo ls -a /root

How To Display Hidden Files In Linux Using Aliases

Aliases save time. Add these to your .bashrc:

alias la='ls -a'
alias ll='ls -al'
alias l='ls -CF'

After reloading, la shows all files, and ll shows detailed listing.

How To Display Hidden Files In Linux In A Single Line

For quick checks, use:

ls -a

Or for a detailed view:

ls -al

These are the most common one-liners.

How To Display Hidden Files In Linux Using The Stat Command

The stat command shows file details. To see hidden files, combine with ls:

ls -a | xargs stat

This shows metadata for all files, including hidden ones.

How To Display Hidden Files In Linux With The Dir Command

The dir command works like ls but with different defaults. Use dir -a to show hidden files:

dir -a

It is less common but available on most systems.

How To Display Hidden Files In Linux Using The Vdir Command

vdir is another variant that lists files in long format. Use vdir -a:

vdir -a

How To Display Hidden Files In Linux With The Lsblk Command

This is for block devices, not regular files. But if you need to see hidden partitions, lsblk -a shows all.

How To Display Hidden Files In Linux In A Cron Job

You can automate listing hidden files with cron. For example, to log hidden files daily:

0 2 * * * ls -a /home/user > /tmp/hidden.log

How To Display Hidden Files In Linux For Troubleshooting

When debugging, hidden files often hold clues. Check .bash_history, .ssh, and .config directories. Use ls -al ~ to see all user configs.

Frequently Asked Questions

How Do I Show Hidden Files In Linux Terminal?

Use the ls -a command. For a detailed view, use ls -al. You can also use find or tree with the -a flag.

What Is The Shortcut To Show Hidden Files In Linux File Manager?

Most file managers use Ctrl + H. Dolphin uses Alt + . (period). Check the View menu if unsure.

How To See Hidden Files In Linux Permanently?

Set an alias in your .bashrc file, such as alias la='ls -a'. For file managers, enable the option in Preferences.

How To Display Hidden Files In Linux Using The Find Command?

Run find /path -name ".*" -type f to list all hidden files recursively. Use -maxdepth to limit depth.

Why Are Hidden Files Hidden In Linux?

To reduce clutter. Files starting with a dot are usually configuration files that you do not need to see daily. They are not secret.

Now you know multiple ways to handle hidden files in Linux. Whether you prefer the terminal or a graphical interface, the steps are simple and consistent. Practice these commands to become more efficient with your system.