Listing files and directories with ls - Bash

This article covers how to use the bash command ls.


If you want to list all of the items in a directory, you can use the ls command.

ls

If I run this command in the root of this blog, I'd get the following:

using bash ls

Note that hidden files & folders, and those that begin with a . will not show in this list.

Showing hidden files/folders

In a git directory, there are often many folders that begin with . (there will be .git at the very least).

These won't appear when using the command by itself.

Also, hidden files and folders won't appear, until you provide the -a (all) parameter:

ls -a

using bash ls

Showing more detail

To get a more detailed output from the ls command, you can use the -l (long) parameter:

ls -l

using bash ls