In a Linux-based operating system, navigating through directories is challenging. A directory is a path where your subdirectories or files are stored.  Ubuntu 22.04 provides the facility of the terminal as a command line interface tool for interacting with directories and has a GUI File Manager (Files) to open and interact with the directories directly.

In this article, we’ll explain how you can interact with the directories.

How do I list only directories in Linux ls (Ubuntu)?

To enlist the directories only we use terminal and GUI File Manager in Ubuntu. If you want to list only the directories in Ubuntu 22 follow these two methods:

Method 1: Using Terminal

Open your terminal window and execute the following command

$ ls -l | grep ^d

The command will list down all the directories of the parent directory

If you want to list down all hidden directories as well, type and execute the following command

$ ls -al | grep ^d

Method 2: Using GUI

Click on the Files icon on the Ubuntu desktop:

It will open the directories in it:

It will not display the hidden directories, To display hidden directories proceed with the following step:

Click on the Hamburger menu on the right side of the window:

Check the Show Hidden Files option:

But keep in mind it will also display the files and the directories. These were some methods to list down directories in Linux Ubuntu 22.04.


To list down directories use the terminal with the command “ls -l | grep ^d” and to view hidden directories use the command “ls -al | grep ^d”. You can also use the Files folder to navigate through the directories, and list down the directories. In this article, we have learned how to list down directories with different commands.