Study guide
2.3 Using Directories and Listing Files
LPI Linux Essentials Certificate 010-160
Track your progress as you read
Finished sections get a check mark.
1 Introduction & Exam Overview
1.1 Current Exam Facts 1.2 Study Strategy & Blueprint Weights
2 Topic 1: The Linux Community and a Career in Open Source
1.1 Linux Evolution and Popular Operating Systems 1.2 Major Open Source Applications 1.3 Open Source Software and Licensing 1.4 ICT Skills and Working in Linux
3 Topic 2 Part A: Command Line Basics & Getting Help
2.1a Bash Shell, Command Syntax & Variables 2.1b Quoting, History & Safe Command Syntax 2.2 Using the Command Line to Get Help
4 Topic 2 Part B: Directories, Listing & File Operations
2.3 Using Directories and Listing Files 2.4 Creating, Moving and Deleting Files
5 Topic 3 Part A: Archiving & Searching Data
3.1 Archiving and Compression on the Command Line 3.2a Pipes, Redirection, and Basic Regular Expressions 3.2b grep and Text Extraction Tools
6 Topic 3 Part B: Turning Commands into Scripts
3.3a Script Basics: Shebang, Variables, and Arguments 3.3b Loops, Exit Status, and Simple Conditionals 3.3c Editors, chmod +x, and Running Scripts
7 Topic 4 Part A: Choosing an OS, Hardware & FHS Basics
4.1 Choosing an Operating System 4.2 Understanding Computer Hardware 4.3a Where Programs and Configuration Live (FHS Basics)
8 Topic 4 Part B: Processes, Logs & Networking
4.3b Processes, Memory & Logs 4.4 Your Computer on the Network
9 Topic 5: Security and File Permissions
5.1 Basic Security and Identifying User Types 5.2 Creating Users and Groups 5.3 Managing File Permissions and Ownership 5.4 Special Directories and Files
2.3 Using Directories and Listing Files
Key Takeaways Explain This Topic AI
Linux organizes data as a single directory tree; files hold content and directories hold names that point to other files or directories
Names beginning with a dot are hidden; ls without -a omits them, while ls -a (or ls -A) reveals them
Absolute paths start at /; relative paths start from the current working directory; ~ expands to your home directory
cd changes directory; . means the current directory and .. means the parent; cd or cd ~ returns to home
ls lists directory entries; common flags include -l (long), -a/-A (hidden), -h (human sizes), -R (recursive), and -d (list the directory itself)
Last updated: July 2026
2.3 Using Directories and Listing Files
Quick Answer: Everything on a Linux system lives in one directory tree rooted at / . You move with cd , see names with ls , and address locations with absolute paths (from / ), relative paths (from where you are), or ~ for your home. Dotfiles stay hidden until you ask ls to show them with -a or -A .
Objective 2.3 is about finding your way : files vs directories, paths, home, hidden names, cd , and ls .
Files Versus Directories
A file stores content (text, a program, an image). A directory stores a list of names that refer to other files or directories. Directories form a hierarchy: each directory except / has a parent, and most have children.
On the command line you work with pathnames . Two styles matter on every location question:
- Path type Starts with Resolved from Example
- Absolute / Filesystem root /etc/hosts , /home/alex/notes.txt
- Relative anything else Current working directory notes.txt , docs/readme , ../backup
Absolute paths always mean the same place. Relative paths change when you cd . Confirm location with pwd if unsure.
Home Directories and ~
Each normal user has a home directory —a personal starting place for documents and configuration. On most systems that path looks like /home/username . The root account’s home is usually /root .
- The shell expands ~ to the current user’s home directory: cd ~
- cd ~/Documents
ls ~/.
Bare cd with no arguments also returns you to your home directory—the same destination as cd ~ . Many Essentials tasks happen under ~ , while system files live under absolute paths such as /etc .
Hidden Files and Directories
Any name that begins with a dot ( . ) is a hidden file or directory: .bashrc , .ssh , .config . Hidden does not mean encrypted—it only means ordinary listings skip those names. ls # omits names that start with .
ls -a # show all entries, including . and .. and hidden names
ls -A # almost all: hidden names, but usually not . and ..
Exam trap: If a question asks how to see .bashrc in a listing, the answer involves -a or -A (or an explicit path to that name), not a second ls with no options.
Absolute Paths, Relative Paths, . , and ..
Two special directory names appear in every listing that includes them:
- Name Meaning
- . The current directory
- .. The parent directory (one level up)
Use them constantly in relative paths: cd ..
cd ../..
ls ./scripts
cp ../shared/config.txt .
From /home/alex , relative projects/app matches absolute /home/alex/projects/app . From that app directory, .. is projects and ../.. is home.
- Worked path scenario
- Suppose pwd prints /home/sam/lab : /home/sam/
- lab/
- notes.txt
- data/
- sample.csv
- .bashrc
- You type Effect
- ls Shows notes.txt and data (not .bashrc )
- ls -a ~ Lists home including .bashrc
- cd data Working directory becomes /home/sam/lab/data
- cd .. Back to /home/sam/lab
- ls /home/sam/lab/notes.txt Absolute path to the file from anywhere
- ls ../.bashrc Relative path from lab up to home’s hidden file
Same destination, three path styles—practice reading all three on sight: ls /home/sam/lab/data/sample.csv # absolute from /
- ls data/sample.csv # relative from /home/sam/lab
- ls ~/lab/data/sample.csv # via home shortcut
- ls ./data/../notes.txt # . and .. cancel; resolves to notes.txt here
- ls ../../etc/hosts # climb toward root (from deep under /home)
If you cd /tmp first, ls data/sample.csv no longer finds Sam’s file, but ls /home/sam/lab/data/sample.csv and ls ~/lab/data/sample.csv (for user sam ) still do. That contrast is the exam point of absolute versus relative paths.