How do you list only files in a directory Linux?
Nathan Sanders
Updated on June 01, 2026
Linux or UNIX-like system use the ls command to list files and directories. However, ls does not have an option to list only directories. You can use combination of ls command, find command, and grep command to list directory names only. You can use the find command too.
Which command in Linux is used to list all the files in the current directory?
The ls command
The ls command is used to list files. “ls” on its own lists all files in the current directory except for hidden files.
How you list only hidden files?
To view hidden files, run the ls command with the -a flag which enables viewing of all files in a directory or -al flag for long listing. From a GUI file manager, go to View and check the option Show Hidden Files to view hidden files or directories.
How do I show only hidden files?
Open File Explorer from the taskbar. Select View > Options > Change folder and search options. Select the View tab and, in Advanced settings, select Show hidden files, folders, and drives and OK.
How to find a directory in Linux?
– Navigate to the directory you want search inside of. – Click the Search button at the top of the Files window. – In the search bar’s dropdown menu, select Folders in the What category, as shown below, and then select File Name .
How do I create a directory in Linux?
To create a directory in Linux, Unix , or any variant, use the mkdir Linux and Unix command. For example, below we are creating a new directory called hope in the current directory. mkdir hope. Tip: Once the directory has been created you can use the cd command to change the directory and move into that directory.
How do I open a file in Linux?
In order to search for files using the Linux command line, you will need to open a terminal window. There are many ways to open a terminal window. One way that is sure to work on most Linux systems is to press the CTRL, ALT and T key at the same time.
What is the Active Directory in Linux?
FreeIPA is the Active Directory equivalent in the Linux world. It is a Identity Management package that bundles OpenLDAP , Kerberos, DNS, NTP, and a certificate authority together.