Red Hat Linux Ls Command Training - How Run the Ls Command With Examples
It is used to list the contents of a directory and show the files and other directories in a directory.
In the Windows world, a Linux directory is called a Windows folder.
There are lots of options that can be used with the ls command to see different information on the files and directories that are in a directory.
Running the Linux ls Command with Examples of Options You can run the following Linux ls command examples at the command line prompt to get real, practical commands training experience! Linux Commands Training Tips: When you run the ls commands below, with the examples of ls command options and parameters, don't type in the $ (dollar sign) prompt.
Just type in the commands shown at the right of the $ sign.
Run the ls command without any options to see the contents of the current directory.
- $ ls
- $ ls -l
- $ ls -la
Many of the directory names that appear in the / (root) directory are common to all Linux distros.
Notice that a directory named sbin (for superuser binaries) appears.
- $ ls /
- $ ls /sbin
- $ ls -l /sbin
You can see the size of items in the fifth column from the left.
And you can click on the scroll bar on the right side of the terminal emulation window to scroll up!
- $ ls -lS /sbin
- $ ls -lSr /sbin
- $ ls -lSrh /sbin
By learning the GNU Linux commands, you learn how to use ALL Linux versions!