How to List All Files of a Directory in Linux/h1>


In this article, we show how to list all files of a directory in linux.

So listing all files of a directory (including individual files and directories) are important for debugging purposes or just knowing what is inside of a directory.

To list all files of a directory in linux, simply go to the directory that you want to examine and then type in, ls

This is shown below.

The keyword, ls, will list all the contents of a directory.

This includes files, such as maybe images files, html files, etc, as well as all directories (in that directory).

So below, we show the contents of the myproject directory in the linux command terminal.

Listing all contents of a directory in linux

So you can see that you're in the myprojects directory.

We then use, ls, to list the contents of the directory.

We can see that in this directory, we have the directories, Articles, Contact Goooo, images, myproject, static, and venv. We alos have an sqlite3 file called db.sqlite3. We also have a file.

So you can clearly see all the contents of a file.

And this is how to list all the files of a directory in linux.

Related Resources

How to Randomly Select From or Shuffle a List in Python

HTML Comment Box is loading comments...