How to List All Hidden Files and Directories in Ubuntu Using ls -a

The Secret Files of Linux

In Ubuntu Linux, any file or directory whose name begins with a period (for example, .bashrc or .config) is automatically classified as a hidden file. These files are typically used to store critical system settings, user preferences, and application configurations that average users rarely need to edit. By default, standard graphical file managers and basic terminal commands will completely ignore these files to keep your view clean. However, if you are trying to edit your terminal aliases, configure a git repository, or troubleshoot a crashing application, you must be able to view these hidden items.

Using the ls -a Command

The standard ls command simply lists the visible contents of a directory. To reveal the hidden files, you must use a specific flag.

  1. Open your Terminal application (Ctrl + Alt + T) or log into your server via SSH.
  2. Navigate to the directory you want to inspect (e.g., your home folder).
  3. Type the following command:
  4. ls -a
  5. Press Enter.

The -a flag stands for “all.” The terminal will instantly print a complete list of everything in the folder, with all the hidden “dotfiles” clearly visible at the top of the list.

Improving the Output Readability

If a folder contains dozens of hidden files, the raw output of ls -a can be difficult to read, as it simply dumps names into a chaotic horizontal grid. For a much cleaner view, combine it with the -l (long format) flag:

  1. ls -la

This combined command will print a beautiful, vertically aligned list. Not only will you see every hidden file and directory, but you will also see their file sizes, exact creation dates, and current read/write permission structures.

Get the best tech tips delivered straight to your inbox.

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