Skip to main content

Essential Linux Commands for Beginners: A Technical Reference


Technical Scope

To ensure clarity for the reader, this reference guide is defined by the following parameters:

  • Scope: Focused on file system navigation and basic Command Line Interface (CLI) usage.
  • Non-Goals: This document does not cover shell scripting, advanced permissions, or package management.

Overview

This is a reference guide targeted at new Linux users. It lists commonly used commands for file system navigation and basic terminal usage.

tip

Examples will focus on the path /home/username for consistency.

1. File and Directory Management

ls - List Directory Contents

Lists all files and directories in the specified path or current directory.

  • Usage: ls [options]

  • Example: ls /home/username/Desktop

Common Flags for ls

FlagNameDescription
-aAllShows all files, including hidden ones (starting with a dot).
-lLongDisplays detailed information (permissions, owner, size, and date).
-hHuman-readableWhen used with -l, it shows file sizes in KB, MB, or GB.
-RRecursiveLists all files in the current directory and all subdirectories.
tip

You can combine flags. For example, ls -lah provides a detailed, human-readable list of all files.

cd - Change Directory

Navigates between different folders in the file system.

  • Usage: cd [path]

  • Example: cd /home/username/Desktop

mkdir - Make Directory

Creates a new, empty directory.

  • Usage: mkdir [directory_name]

  • Example: mkdir /home/username/Desktop/NewDirectory


2. File Operations

CommandDescriptionBasic Usage
cpCopies files or directories from one location to another.cp source destination
mvMoves or renames files and directories.mv old_name new_name
rmDeletes files. Use with caution.rm file_name
touchCreates a new empty file or updates the timestamp of an existing one.touch index.html
caution

Files deleted with rm cannot be recovered.


3. Viewing and Searching Content

cat - Concatenate and Display

Displays the entire content of a file directly in the terminal window.

  • Usage: cat filename.txt

grep - Global Regular Expression Print

Searches for text patterns within files.

  • Usage: grep "index" /home/username/Desktop/NewDirectory/file_list.txt
tip

Combine grep with other commands using pipes to filter outputs (e.g., ls /home/username/Desktop | grep ".png")


4. System and Permissions

sudo - SuperUser Do

Executes a command with administrative (root) privileges.

  • Usage: sudo [command]

  • Example: sudo mkdir /home/username/Desktop/ProtectedFolder

man - Manual

Displays the official documentation manual for any command.

  • Usage: man ls