
Babak K. Shandiz
Posted on • Originally published atbabakks.github.io on
Living in the Shell #5; ls (List Files/Directories)
ls
🚚
Lists directory content.
Long list (detailed format)-l
cd ~&&ls-l
drwxr-xr-x 5 babak babak 4096 Nov 1 12:49 Desktopdrwxr-xr-x 9 babak babak 4096 Nov 21 18:49 Documentsdrwxr-xr-x 2 babak babak 20480 Nov 23 17:21 Pictures...
Show directories first--group-directories-first
cd ~&&ls--group-directories-first
List directory itself, not its content-d
cd ~&&ls-lhd Documents
drwxr-xr-x 9 babak babak 4.0K Nov 21 18:49 Documents
List all files (include dot-files)-a
cd ~&&ls-a
Print human-readable sizes-h
cd ~&&ls-lh
drwxr-xr-x 5 babak babak 4.0K Nov 1 12:49 Desktopdrwxr-xr-x 9 babak babak 4.0K Nov 21 18:49 Documentsdrwxr-xr-x 2 babak babak 20K Nov 23 17:21 Pictures...
Sort by time-t
cd ~&&ls-lht
drwxr-xr-x 2 babak babak 20K Nov 23 17:21 Picturesdrwxr-xr-x 9 babak babak 4.0K Nov 21 18:49 Documentsdrwxr-xr-x 5 babak babak 4.0K Nov 1 12:49 Desktop
Sort by size-s
cd ~&&ls-lhs
Reverse sort order-r
cd ~&&ls-lhsr
drwxr-xr-x 2 babak babak 20K Nov 23 17:21 Picturesdrwxr-xr-x 9 babak babak 4.0K Nov 21 18:49 Documentsdrwxr-xr-x 5 babak babak 4.0K Nov 1 12:49 Desktop
Top comments(2)
Subscribe

Waylon Walker•
👋 Hey there, I am Waylon WalkerI am a Husband, Father of two beautiful children, Senior Python Developer currently working in the Data Engineering platform space. I am a continuous learner, and sha
- LocationPeoria, Illinois
- WorkPython Dev
- Joined
My favorites are
ls -laht
ls -1
For further actions, you may consider blocking this person and/orreporting abuse