ls flags & options
-l
Long listing format. Shows permissions, owner, size, and modification date.
ls -l
-a, --all
Show all files including hidden files (starting with .).
ls -a
ls -la
-h, --human-readable
Show file sizes in human-readable format (K, M, G). Use with -l.
ls -lh
-R, --recursive
List subdirectories recursively.
ls -R
-t
Sort by modification time, newest first.
ls -lt
-S
Sort by file size, largest first.
ls -lS
-r, --reverse
Reverse the sort order.
ls -ltr
-1
List one file per line.
ls -1
-d
List directories themselves, not their contents.
ls -d */
ls -ld /etc
--color
Colorize output. Usually auto by default in most shells.
ls --color=always | less -R
-i, --inode
Show inode number for each file.
ls -li