• Home
  • Python
    • Introduction to Python
    • Python Developer
  • JavaScript
    • Introduction to JavaScript
    • JavaScript Developer
  • React.js
    • Introduction to React
    • React Developer
  • TypeScript
    • Introduction to TypeScript
    • TypeScript Developer
  • Linux Shell
    • Introduction to the Linux Shell
    • Linux Shell Developer
  • C++
    • Introduction to C++
    • C++ Developer
  • C Language
    • Introduction to C
    • C Developer
  • Rust
    • Introduction to Rust
    • Rust Developer
  • Zig
    • Introduction to Zig
    • Zig Developer
  • Interactive Training
  • Pricing
  • Brainstorm
STEMTrainingGrounds
  • Courses
    • Home
    • Python
      • Introduction to Python
      • Python Developer
    • JavaScript
      • Introduction to JavaScript
      • JavaScript Developer
    • React
      • Introduction to React
      • React Developer
    • TypeScript
      • Introduction to TypeScript
      • TypeScript Developer
    • Linux Shell
      • Introduction to the Linux Shell
      • Linux Shell Developer
    • C++
      • Introduction to C++
      • C++ Developer
    • C Language
      • Introduction to C
      • C Developer
    • Rust
      • Introduction to Rust
      • Rust Developer
    • Zig
      • Introduction to Zig
      • Zig Developer
  • Interactive Training
  • Pricing
  • Navigate
    • Home
    • Reading Grounds
    • Brainstorm

Quick Links

  • About Us
  • Pricing
  • Partnership
  • Brainstorm
  • Terms
  • Privacy
  • Refunds

Courses

  • Python
    • Introduction to Python
    • Python Developer
  • JavaScript
    • Introduction to JavaScript
    • JavaScript Developer
  • React
    • Introduction to React
    • React Developer
  • TypeScript
    • Introduction to TypeScript
    • TypeScript Developer
  • Linux Shell
    • Introduction to the Linux Shell
    • Linux Shell Developer
  • C++
    • Introduction to C++
    • C++ Developer
  • C Language
    • Introduction to C
    • C Developer
  • Rust
    • Introduction to Rust
    • Rust Developer

Newsletter

Subscribe to our free monthly newsletter, for a quick update on Python, JavaScript, and React news

© 2025 - 2026 STEMTrainingGrounds. All Rights Reserved.

Introduction to the Linux Shell -

Lesson 1 of 23

Lesson Progress: 0%

Lesson Progress: 0%
Lesson Incomplete
Lesson 1 of 23
Next: Linux ls command II →

The lscommand is one of the most commonly used commands in the Linux shell. It stands for "list" and shows you what files and folders are inside a directory. When you open a terminal, you are usually placed inside your home folder, and typing ls will display everything in that folder. You can also give ls a path to a specific folder, like ls Documents, to see what is inside that folder instead. The ls command has many options, called flags, that change how the information is shown. For example, the -a flag reveals hidden files (files that start with a dot), and the -l flag shows extra details like file size and permissions. Learning to use ls well will help you navigate and understand your filesystem quickly and confidently.

  • When you type ls by itself, the shell lists the files and folders in your current directory.
  • Your current directory is the folder you are standing in, shown at the beginning of the prompt like ~/home/user.
  • In this simulator your home folder contains three folders: Desktop, Documents, and Downloads.
  • The output of ls shows the names separated by spaces, so you can quickly see what is available.
  • Try typing ls and pressing Enter to see the list of items in your current directory.
  • You can give ls a path to a specific folder, like ls Documents, to see what is inside that folder.
  • The path can be a folder name inside your current directory, such as Documents or Downloads.
  • If the folder exists, lsshows its contents instead of the current directory's contents.
  • If you try ls Music and there is no Music folder, the shell will tell you it does not exist.
  • Using a path with ls lets you peek inside any folder without changing your current location.
  • Files and folders whose names start with a dot (.) are hidden and will not show up with a plain ls.
  • The -a flag stands for "all" and tells ls to include hidden items in the listing.
  • In your home folder there is a hidden file called .bashrc that stores shell settings.
  • Type ls -a to see .bashrc appear alongside the regular folders.
  • Hidden files are used for configuration and are hidden on purpose to keep your home folder looking clean.
  • The -lflag stands for "long format" and shows extra information about each file and folder.
  • Each line starts with a column of letters like drwxr-xr-x that shows permissions: who can read, write, or run the item.
  • The first letter tells you the type: d means directory (folder), - means a regular file.
  • After the permissions you see the owner, group, file size, last-modified date, and the name.
  • Type ls -l to see detailed information about every item in your current directory.
  • You can combine flags by writing them one after the other, like -la.
  • ls -lameans "list all files in long format" — it shows hidden files with full details.
  • The order of the letters does not matter: -la and -al do the same thing.
  • When you run ls -la, you will see .bashrc listed with its permissions, size, and date.
  • Combining flags saves typing and is a common habit among Linux users.
  • The asterisk *is called a wildcard and stands for "any characters."
  • When you write ls Desk*, the shell matches any item whose name starts with "Desk" followed by anything else.
  • In this simulator ls Desk* matches the Desktopfolder because "Desk" + "top" fits the pattern.
  • If no item matches the pattern, the shell tells you that the file or folder does not exist.
  • Wildcards are very powerful — you can use them to work with groups of files that share part of a name.

Test Incomplete

What does the ls command do in the Linux shell?

Question #

1/15

Score

0/0 - 0.0 %

Task Incomplete
Example
~$ ls
  • Run ls with no arguments
Linux Shell
user@linuxsim:~$
Task Incomplete
Example
~$ ls Documents
  • Run ls with a directory path like Documents
Linux Shell
user@linuxsim:~$
Task Incomplete
Example
~$ ls -a
  • Run ls -a to show hidden files
Linux Shell
~$
Task Incomplete
Example
~$ ls -l
  • Run ls -l for a detailed listing
Linux Shell
~$
Task Incomplete
Example
~$ ls -la
  • Run ls -la to see all files in long format
Linux Shell
~$
Task Incomplete
Example
~$ ls Desk*
  • Run ls with a wildcard pattern like Desk*
Linux Shell
~$