Easy Tutorial
❮ Linux Comm Top Linux Comm Wall ❯

Linux ls Command

Linux Command Manual

The ls command in Linux (short for "list directory contents") is used to display the contents of a specified working directory (list the files and subdirectories contained in the current working directory).

Syntax

ls [-alrtAFR] [name...]

Parameters:

Examples

List all directories under the root directory ():

# ls /
bin               dev   lib         media  net   root     srv  upload  www
boot              etc   lib64       misc   opt   sbin     sys  usr
home  lost+found  mnt    proc  selinux  tmp  var

List all files starting with 's' in the current working directory, sorted by modification time, with the newest last:

ls -ltr s*

List all directories and files under the /bin directory with detailed information:

ls -lR /bin

List all files and directories in the current working directory; append "/" to directory names and "*" to executable files:

ls -AF

Linux Command Manual

❮ Linux Comm Top Linux Comm Wall ❯