How to View Hidden Files and Folders in Linux Terminal

In Linux, hidden files and folders are used to store user-specific configuration data and application settings. By convention, any file or directory whose name begins with a dot (e.g., .bashrc or .config/) is considered hidden by the operating system.

When you use the standard ls command in the terminal to list directory contents, these dotfiles are excluded from the output by default to keep the terminal uncluttered. To view them, you must use specific command-line flags.

How to View Hidden Files Using the ls Command

To reveal hidden files alongside regular files, you need to append the -a (all) flag to the ls command.

ls -a

This will display all files in the current directory, including dotfiles. You will also notice two special directories in the output: . (which represents the current directory) and .. (which represents the parent directory).

How to View Hidden Files Without . and ..

If you find the . and .. directories annoying, you can use the -A (almost all) flag instead. This shows all hidden files but omits the current and parent directory pointers.

ls -A

Formatting the Output for Readability

Simply listing the names of hidden files is often not enough. System administrators usually need to see the file sizes, permissions, and modification dates. You can combine the -a flag with the -l (long format) flag to get a detailed view.

ls -la

This command is the standard way most Linux power users navigate directories. It lists every single file (including hidden ones) in a neat, vertical column, displaying read/write/execute permissions, file owners, exact file sizes in bytes, and the date the file was last modified.

If you prefer human-readable file sizes (e.g., “4K” instead of “4096”), you can add the -h flag:

ls -lah

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.