Linux: ls Command Options Cheat Sheet

# List all files including hidden file

ls -a

# Recursive list

ls -R

# Reverse order

ls -r

# Colored list [=always/never/auto]

ls --color

# List directories – with ‘ */’

ls -d

# Add one char of */=>@| to enteries

ls -F

# List file’s inode index number

ls -i

# Sort by last modified

ls -t

# Sort by file size

ls -S

# List file size

ls -s

# List with long format – show permissions

ls -l

# List long format including hidden files

ls -la

# List long format with readable file size

ls -lh

# List with long format with file size

ls -ls

# One file per line

ls -1

# Comma-­sep­arated output

ls -m

# Quoted output

ls -Q

# Sort by extension name

ls -X

Leave a Reply

Your email address will not be published. Required fields are marked *