Chapter 6: Bash List (Is)

Bash List (ls) — or as most people say, the ls command.

You wrote “Bash List (Is)” — I think you mean ls (the letter “L” + “S”), because in Bash/Unix/Linux, the command to list files and folders is spelled ls (not “is”).

ls is probably the number 1 most used command in the entire terminal world. Every time you want to know “What’s inside this folder?” — you type ls.

Let me explain it like we’re sitting together in Hyderabad, practicing on your laptop, step-by-step, with real examples, what each part means, common combinations, and pro tips.

What does “ls” actually stand for?

ls = list (or sometimes people joke “list storage”)

It comes from very old Unix days (1970s). It simply lists the names of files and directories in a folder.

Basic Usage — Just type ls

Open terminal → type:

Bash

Example output (yours will be different):

text
  • It shows non-hidden files and folders in current location
  • Folders usually have no special mark (but many terminals color them blue)
  • Files are white or default color

Most Important Variations (You will use these every day!)

  1. ls -l → Long format (shows details — super useful!)
Bash

Example output:

text

What each column means (very important!):

Column What it shows Example from above Meaning
1 File type & permissions drwxr-xr-x d = directory, – = normal file, rwx = read/write/execute for owner/group/others
2 Number of hard links 2 Usually 1 for files, 2+ for dirs
3 Owner (user) webliance Who owns it
4 Group webliance Group permission
5 Size in bytes 4096 or 456 Folder size is block size, not contents
6-8 Last modified date/time Feb 25 13:10 When changed last
9 Name Documents The file/folder name
  1. ls -a → Show All (including hidden files)

Hidden files start with . (dot) — like .bashrc, .git, .ssh

Bash

Output example:

text
  • . = current folder
  • .. = parent folder
  • Everything else starting with . is hidden config stuff
  1. ls -la or ls -al → Long + All (most common combo!)
Bash

→ Shows details + hidden files — you’ll type this 50 times a day!

  1. ls -lh → Long + Human-readable sizes
Bash

Output:

text

→ Sizes in K, M, G instead of raw bytes — much easier to read!

  1. ls -lah → The ultimate beginner combo (long + all + human)
Bash

Most people alias this to ll in their .bashrc (we’ll learn aliases later)

Sorting & Ordering Tricks

  1. ls -lt → Sort by time (newest first)
Bash

→ Latest modified file at top — great for finding recent work

  1. ls -ltr → Reverse time (oldest first)
Bash

→ Very useful with tail later: ls -ltr | tail -5 = last 5 modified files

  1. ls -lS → Sort by size (largest first)
Bash

Other Handy Options

  1. ls -F → Show type with symbols
Bash

→ Adds / after folders, * after executables, @ for links, etc.

Example:

text
  1. ls -R → Recursive (show subfolders too)
Bash

→ Dumps everything deep inside — can be long!

  1. *ls .txt → Only certain files (pattern matching)
Bash
  1. ls -i → Show inode numbers (advanced, for hard links)

Super Common Combinations Table (Memorize these!)

You type What you get When to use
ls Simple names Quick peek
ls -l Detailed list Check permissions/size/date
ls -a See hidden files Looking for .git / .env / .bashrc
ls -la / ls -al Detailed + hidden Almost every time!
ls -lah Detailed + hidden + nice sizes Best daily command (alias as ll)
ls -ltrh By time reverse + human sizes Find newest/big files
ls -lSh By size descending + human Find space hogs
ls -F With type indicators See what’s executable/folder

Practice Right Now (5 minutes!)

Bash

See how the output changes? Play with it!

Teacher tip: Many people add this to ~/.bashrc so ll = ls -lah:

Bash

Then just type ll forever — saves typing!

Got it? ls is your eyes in the terminal — master it and you’ll never feel lost.

Any confusion? Want more on permissions (that drwxr-xr-x part)? Or want practice exercises? Or next topic: “Teacher, explain grep” or “pipes with ls” or “how to alias ll”

Keep typing — you’re doing awesome! 🐧🚀 From Hyderabad! 😄

You may also like...

Leave a Reply

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