Linux

Linux Command Basics: A Step-by-Step Guide for Beginners

This guide helps beginners quickly master essential Linux terminal commands. Learn to navigate the filesystem, manage files, and monitor system status.

Updated at April 6, 2026
10-15 min
Easy
FixPedia Team
Применимо к:Ubuntu 22.04/24.04 LTSDebian 12+Fedora 39/40+CentOS Stream 9 / RHEL 9+

Introduction / Why This Is Useful

The Linux terminal isn't a relic of the past—it's the fastest tool for system management. Graphical interfaces are convenient, but the console enables bulk operations, automates routine tasks, and provides precise control over a server or desktop. After completing this guide, you'll be able to navigate directories confidently, manage files, and diagnose basic issues without touching the mouse.

Requirements / Preparation

  • Access to a Linux system (locally or via SSH)
  • A user account with standard user privileges. System operations will require sudo access
  • Internet connection to install additional packages (if necessary)

💡 Tip: Avoid running commands as root unless absolutely necessary. Working as a standard user with sudo protects the system from accidental damage.

In Linux, everything starts at the root /. Understanding the directory structure is the first step to confident console work.

Viewing the Current Directory and Contents

To see where you are, use pwd (print working directory):

pwd

The output will show the full path, for example: /home/your_name.

To list files and folders, use ls (list):

ls -la

The -l flag outputs detailed information (permissions, owner, size, modification date), while -a shows hidden files starting with a dot.

Moving Between Directories

The cd command (change directory) moves you through the filesystem:

cd ~/Documents

Useful shortcuts:

  • cd .. — move up one level
  • cd ~ or just cd — return to your home directory
  • cd - — return to the previous directory

Managing Files and Directories

Creating, copying, and deleting files works logically but requires attention to paths.

Creating, Copying, and Moving

To create a directory:

mkdir -p project/src/docs

The -p flag automatically creates the entire chain of nested directories if they don't exist.

Create an empty file:

touch notes.txt

Copy or move a file:

cp notes.txt ~/Documents/backup_notes.txt
mv backup_notes.txt ~/Downloads/

Safe Deletion

Deletion in the terminal is irreversible. To delete a file:

rm temp.log

To delete a directory and all its contents:

rm -rf project/

⚠️ Important: Always double-check the path before running rm -rf. A mistake in the argument could erase system data.

Monitoring Resources and Searching Information

The console lets you quickly assess system status and find information within text.

Checking Disk and Memory

Check free disk space:

df -h

The -h flag formats output in human-readable units (GB, MB).

Check RAM usage:

free -h

Reading Files and Searching Content

To quickly view the end of a log file:

tail -n 20 /var/log/syslog

Search for a string in a file using grep:

grep "error" /var/log/syslog

The -i flag ignores case, while -r enables recursive search through all files in a directory.

Verification

To confirm you've mastered these skills, complete this test scenario:

  1. Create a test_env folder in your home directory and navigate into it.
  2. Inside, create two files: config.txt and data.log.
  3. Copy config.txt to config_backup.txt.
  4. Verify all files exist using ls -la.
  5. Check disk usage with df -h and free up space by deleting data.log.

If the ls output matches expectations and df shows current data—you've mastered the basics.

Common Issues

  • Permission denied: You're trying to modify a file owned by another user or the system. Add sudo before the command or check permissions with ls -l.
  • Command not found: The package isn't installed or there's a typo. Check syntax or install the utility via your distribution's package manager (e.g., sudo apt install <package_name>).
  • Argument list too long: Occurs when trying to process thousands of files with one command (e.g., rm *). Use find . -type f -delete or break the operation into stages.
  • Spaces in filenames: If a path contains spaces, escape them with a backslash My\ Folder/ or wrap the entire path in quotes "My Folder/".

F.A.Q.

Can you break the system by running terminal commands?
Do I need a graphical interface to learn the console?
How to quickly find out what an unknown command does?

Hints

Open the terminal and update your system
Learn to navigate directories
Create and manage files
Check system status
FixPedia

Free encyclopedia for fixing errors. Step-by-step guides for Windows, Linux, macOS and more.

© 2026 FixPedia. All materials are available for free.

Made with for the community