ls — list directory contents
cheat sheet · Ubuntu 24.04 · GNU coreutils 9.4 https://lab.dimsanych.ru/en/wiki/ls/Cheat sheet
-
lscontents of the current directory -
ls /etccontents of another directory -
ls -llong: permissions, owner, size, time -
ls -lalong, including hidden (.bashrc etc.) -
ls -lhsizes in K, M, G -
ls -ltnewest first -
ls -ltrnewest last — handy for logs -
ls -lSlargest first -
ls -ld /var/logthe directory itself, not its contents -
ls -R projectrecursive, with subdirectories -
ls *.confonly names matching a pattern
Options
Short options can be combined: ls -l -a -h and ls -lah are the same. Full list —
man ls.