The ls command is one of the most commonly used Linux commands for listing available files or directories from the command line.
In this article, we'll go over everything you need to know about Linux ls Command, including some of the most important flags you'll need daily.
In its most basic form, the ls command displays the files and directories in your current directory.
$ ls

Notice, the "ls" command displays its output in alphabetical order. If you're using a color-enabled terminal emulator, the ls listing will display different types of entries in different colors.
If you don't have a terminal emulator that supports colors, you can use the -F parameter with the ls command to easily distinguish between directories and files. The -F parameter flags a folder with a forward slash (/) and an executable with an asterisk (*), as you can see below.
$ ls -F

Linux often uses hidden files to store some configuration information. Hidden files in Linux are those with filenames that begin with a period (.). These files don't appear in the default ls listing, thus called hidden files. The -a parameter with the ls command is used to display hidden files alongside normal folders and files.
$ ls -a

Another option we can use with the ls command is the recursion parameter -R. It displays files contained within subdirectories in the current directory. When you have a lot of subdirectories, the list can get quite long.
Here's an illustration of what the -R parameter can show:
$ ls -RF
