'ls' - list directory contents - Video Man Pages

'ls' - list directory contents - Video Man Pages

D
DistroTube
4 Video Views·Jun 16, 2025

The 'ls' command lists directory contents. It one of the most commonly used commands in the shell.

- List files one per line:
ls -1

- List all files, including hidden files:
ls -a

- Long format list (permissions, ownership, size, and modification date) of all files:
ls -la

- Long format list with size displayed using human-readable units (KiB, MiB, GiB):
ls -lh

- Long format, sorted by modification date (newest first):
ls -lt

- Long format, sorted by modification date, reverse the order (oldest first):
ls -ltr

- Long format list sorted by size (descending):
ls -lS

- Long format list sorted by size, reverse the order (ascending):
ls -lSr

- Only list directories:
ls -d */

- Long format, list all files, use human-readable units and group directories first:
ls -lah --group-directories-first

- A colorful alternative to 'ls' is:
eza

- It has some similar flags to 'ls':
eza -la --group-directories-first

- Add an alias to your shell config so that 'ls' runs 'eza'
alias ls='eza -la --group-directories-first'

WANT TO SUPPORT THE CHANNEL?
💰 Patreon: https://www.patreon.com/distrotube
💳 Paypal: https://www.youtube.com/redirect?event=channel_banner&redir_token=QUFFLUhqazNocEhiaGFBT1l1MnRHbnlIcHFKbXJWVnpQd3xBQ3Jtc0tsLVZJc19YeFlwZ2JqbXVOa3g0Skw4TVhTV2otNm1tM3A1bUNnamh3S2V6OGQtLTBnSjBxYTlvUXMxeEVIS3o4US10NENHMUQ3STk2a01FOFBhUnZjZFctMEhFUTg1TVctQmFfVUdxZXJ4TDl0azlYNA&q=https%3A%2F%2Fwww.paypal.com%2Fcgi-bin%2Fwebscr%3Fcmd%3D_donations%26business%3Dderek%2540distrotube%252ecom%26lc%3DUS%26item_name%3DDistroTube%26no_note%3D0%26currency_code%3DUSD%26bn%3DPP%252dDonationsBF%253abtn_donateCC_LG%252egif%253aNonHostedGuest
🛍️ Amazon: https://amzn.to/2RotFFi
👕 Teespring: https://teespring.com/stores/distrotube

DT ON THE WEB:
🕸️ Website: http://distro.tube
📁 GitLab: https://gitlab.com/dwt1
🗨️ Mastodon: https://fosstodon.org/@distrotube
👫 Reddit: https://www.reddit.com/r/DistroTube/
📽️ Odysee: https://odysee.com/@DistroTube:2

FREE AND OPEN SOURCE SOFTWARE THAT I LIKE:
🌐 Brave Browser - https://brave.com/
📽️ Open Broadcaster Software: https://obsproject.com/
🎬 Kdenlive: https://kdenlive.org
🎨 GIMP: https://www.gimp.org/
💻 VirtualBox: https://www.virtualbox.org/
🗒️ Doom Emacs: https://github.com/hlissner/doom-emacs

Your support is very much appreciated. Thanks, guys!