What is the option used in ls command to list all entries in the current directory including hidden files?

In this article, we explain the ls command in Linux, with its most frequently used command options.

In this article, we explain one of the basic Linux commands for beginners, i.e. the ls command, with its most frequently used command options.

What is Linux?

Linux is a family of open-source operating systems based on the Linux kernel. The first Linux system kernel was released on September 17, 1991, by Linus Torvalds.

Read more …

Popular Linux distributions include Debian, Fedora, and Ubuntu, and the commercial distributions include Red Hat Enterprise Linux and SUSE Linux Enterprise Server.

There are also quite a number of customized Linux distributions, such as Kali Linux, REMnux etc. Kali Linux is a Debian-based distribution developed, funded and maintained by Offensive Security for ethical hackers for the purposes of Penetration Testing, Security Research & Assessment, and Computer Computer Forensics & Reverse Engineering. REMnux, on the other hand, is a Linux distro curated for reverse-engineering and malware analysis purposes.

What is the option used in ls command to list all entries in the current directory including hidden files?
Quote by Jamie Zawinski

I think Linux is a great thing, in the big picture. It’s a great hacker’s tool, and it has a lot of potential to become something more.

Jamie Zawinski

Read more educational and inspirational cyber quotes at our page 100+ Best Cyber Security & Hacker Quotes.

ls Command – List Directory Contents

In Linux, ls command is used to display a list of the files and directories within the file system or to view detailed information (metadata) on specified files and directories.

List information about the FILE(s) (the current directory by default). Basic usage: ls [OPTION] ... [FILE] ... Use -a to list all entries (including the hidden ones that start with .) and -l to list with more details, such as file permissions, file size etc.

Using the ls Command

Simple Listing

To list just the files in a directory without any additional information, use ls.

$ ls
What is the option used in ls command to list all entries in the current directory including hidden files?
Figure 1: Listing Directory Contents with the ls Command

Listing Hidden Files

To list all the files in a directory, including the hidden files, without any additional information, use ls -a. Hidden files begin with a period and not displayed by default.

$ ls -a
What is the option used in ls command to list all entries in the current directory including hidden files?
Figure 2: Listing All the Directory Contents with the ls -a Command

Listing With Detailed Information

To list all the files in a directory, including the hidden files, with additional information (long listing), use ls -la. Note that command options can be combined, thus ls -l -a is the same with ls -la.

$ ls -la
What is the option used in ls command to list all entries in the current directory including hidden files?
Figure 3: Listing Directory Contents with the ls -la Command

The additional information (file permissions, file ownership etc.) displayed for the my-script.sh file is described in more detail in Figure 4.

What is the option used in ls command to list all entries in the current directory including hidden files?
Figure 4: Description of the ls -la Command Output

Denoting File Types

To denote files types with special characters, use ls -F. The / symbol denotes a directory, the @ symbol denotes a linked file, and the * symbol represents an executable file.

$ ls -F
What is the option used in ls command to list all entries in the current directory including hidden files?
Figure 5: Listing Directory Contents with the ls -F Command to Display File Types

Listing by File Date and Time

To list files by time, use ls -t. To reverse the order of listing, -r option could be combined with the -t.

$ ls -t
What is the option used in ls command to list all entries in the current directory including hidden files?
Figure 6: Listing Directory Contents by Time with the ls -latr Command

Listing Recursively All Files in a Directory

To list files recursively in a directory, use ls -R.

$ ls -R
What is the option used in ls command to list all entries in the current directory including hidden files?
Figure 7: Listing Files Recursively with the ls -R Command

Listing Metadata for a Directory

To list metadata for a directory without listing the directory contents, use ls -ld.

$ ls -ld
What is the option used in ls command to list all entries in the current directory including hidden files?
Figure 8: Listing Metadata for a Specific Directory with the ls -ld Command

To explore more ls command options, please visit the man pages by typing $ man ls on the terminal.

To learn more on Linux, you could also visit our Linux Resources Page.


What is the option used in ls command to list all entries in the current directory including hidden files select one?

Show Hidden Files From the Command Line The ls command lists the contents of the current directory. The –a switch lists all files – including hidden files.

What is the option used in ls command to list all entries in the current directory including?

The ls command supports the following options: ls -A: list all files including hidden files except for “.” and “..” – these refer to the entries for the current directory, and for the parent directory. ls -R: list all files recursively, descending down the directory tree from the given path.

Which ls command option can be used to show all files in a directory?

Type the ls -l command to list the contents of the directory in a table format with columns including: content permissions.

What is the option in ls command to display the hidden files or directories?

To display hidden files or directories, we include the a flag in our ls command. The a flag instructs the ls command to include all files — and not ignore files starting with a dot. Using this command, we can now see both the hidden and visible files in the current directory.