Shell Gym

Linux 101: List Files and Use Patterns

Ivan Velichko
by  Ivan Velichko · on
Linux

Inspect directory contents from the Linux terminal, read what a listing tells you, sort it to find the entry you need faster, and use shell patterns to name groups of files.

Linux 101: List Files and Use Patterns Shell Gym (cover image)
Overview

In this Shell Gym, you will learn how to inspect directories from the command line and how to let the shell name groups of files for you with patterns.

Assumed knowledge: you know what files and directories are, can run commands with arguments and options, and can move around the Linux filesystem with absolute and relative paths. You do not need to understand file permissions to complete this gym.

What you will learn:

  • Show the contents of the working directory, of another directory, or of several directories at once, hidden names included.
  • Understand the file listing format: file type, owner, group, size, and modification time.
  • Sort a listing by time or by size to find the newest or the largest entry.
  • Use *, ?, and [...] patterns to name groups of files, and see what a pattern expands to before a command runs.
  • List a file whose name begins with a dash.

A session takes just a few minutes and is meant to be repeated over time until you get fluent in inspecting directories and matching file names.

Learning path
2 modules · 17 units
How a Shell Gym works

Practice in a real terminal

Use a regular shell on a real Linux VM. Each rep is marked complete automatically when you reach the goal.

One skill at a time

Each module focuses on one command or concept, with short exercises to help you get comfortable using it.

Repeat until it sticks

Revisit the gym after 1, 3, 7, 14, 30 days to build command-line habits and remember what you've learned.

Part of your Daily Practice

The gym appears in Daily Practice when it's time to repeat it. Pause when you need a break, or mark it complete when you're comfortable with the skill.

See your progress

Review past sessions to see how long you practiced and how many reps you completed.

Help when you get stuck

Use hints and feedback based on what's happening on your VM to work out the next step without being given the answer.

Learn more about Shell Gyms
Train