mhd_sulu_786
โ† All posts
Guides28 August 2026

๐Ÿ’ป Essential Linux Terminal Commands Every Beginner Should Know

By Muhammed Sulaiman T (WebDeveloper)

Getting comfortable with the Linux terminal is a foundational skill for anyone learning development, cybersecurity, or system administration. This guide covers the essential commands every beginner should know, organized by what you're actually trying to do.

Navigation Commands

pwd (Print Working Directory)

pwd

Shows the full path of the directory you're currently in โ€” genuinely useful when you're not sure where you are within the filesystem.

ls (List)

ls

Lists files and directories in the current location. Common useful flags:

ls -l    # Detailed list view with permissions, size, and date
ls -a    # Show hidden files (those starting with a dot)
ls -la   # Combine both for a detailed view including hidden files

cd (Change Directory)

cd /path/to/directory
cd ..        # Move up one directory level
cd ~         # Go to your home directory
cd -         # Go back to the previous directory you were in

File and Directory Management

mkdir (Make Directory)

mkdir new_folder
mkdir -p parent/child/grandchild   # Create nested directories at once

touch (Create Empty File)

touch newfile.txt

cp (Copy)

cp source.txt destination.txt
cp -r source_folder/ destination_folder/   # -r for recursive, needed for directories

mv (Move / Rename)

mv oldname.txt newname.txt              # Renaming a file
mv file.txt /path/to/new/location/       # Moving a file

rm (Remove)

rm file.txt
rm -r folder_name/     # Recursive removal for directories
rm -rf folder_name/    # Force removal without confirmation prompts โ€” use with genuine caution

The -rf flag combination is powerful and unforgiving โ€” there's no recycle bin recovery in most terminal environments, so double-check the target path before running it.

Viewing and Editing File Content

cat (Concatenate/Display)

cat filename.txt

Displays the entire content of a file directly in the terminal, useful for quickly viewing shorter files.

less / more (Paginated Viewing)

less filename.txt

Displays file content one screen at a time, better for viewing longer files without flooding your terminal. Press q to quit.

head / tail (View Beginning/End of File)

head filename.txt        # Shows the first 10 lines by default
tail filename.txt        # Shows the last 10 lines by default
tail -f logfile.txt      # Follow a file in real-time, useful for monitoring active log files

nano / vim (Text Editors)

nano filename.txt     # Beginner-friendly terminal text editor
vim filename.txt      # More powerful but steeper learning curve

Nano is generally recommended for beginners due to its visible on-screen keyboard shortcuts, while vim has a significantly steeper but ultimately more efficient learning curve favored by many experienced users.

Searching and Finding

find (Search for Files)

find /path -name "filename.txt"
find . -type f -name "*.log"    # Find all .log files in current directory and subdirectories

grep (Search Text Within Files)

grep "search_term" filename.txt
grep -r "search_term" /path/to/directory/   # Recursive search through all files in a directory

grep is an essential tool for searching through log files and codebases, and combining it with other commands (through piping) makes it significantly more powerful.

System Information

whoami

whoami

Shows the currently logged-in username.

df (Disk Free)

df -h

Shows disk space usage across mounted filesystems, with -h displaying sizes in human-readable format (GB, MB) rather than raw byte counts.

top / htop

top

Shows real-time system resource usage, including running processes, CPU, and memory usage. htop (if installed) provides a more visually organized, interactive version.

ps (Process Status)

ps aux

Lists currently running processes, useful for identifying resource-heavy or unfamiliar processes.

Permissions and Ownership

chmod (Change Permissions)

chmod +x script.sh       # Add execute permission
chmod 755 script.sh      # Set specific numeric permissions

sudo (Superuser Do)

sudo command_here

Runs a command with elevated (administrator/root) privileges, required for many system-level operations. Use with caution, since elevated commands can make significant, sometimes irreversible system changes.

Piping and Combining Commands

One of the most powerful aspects of the Linux terminal is the ability to chain commands together using the pipe (|) symbol, feeding the output of one command as input to another:

ps aux | grep firefox        # Find processes related to firefox
cat logfile.txt | grep "error"   # Search a file's content for the word "error"

Package Management (Debian/Kali/Ubuntu)

sudo apt update              # Refresh the list of available packages
sudo apt install package_name   # Install a new package
sudo apt upgrade             # Upgrade all installed packages to their latest versions
sudo apt remove package_name    # Remove an installed package

Getting Help

man (Manual Pages)

man command_name

Displays the official documentation for a command, including all available options and usage examples โ€” genuinely the best first resource when you're unsure how a specific command works.

command_name --help

Many commands also support a --help flag for a quicker, more condensed reference than the full manual page.

Practical Tips for Beginners

  • Use Tab for autocompletion โ€” start typing a filename or command and press Tab to auto-complete it, reducing typos and saving time.
  • Use the up arrow to recall previous commands rather than retyping them from scratch.
  • Practice in a safe environment โ€” a virtual machine or dedicated practice system lets you experiment freely without risking your primary system.
  • Read error messages carefully โ€” Linux error messages are often genuinely informative once you get used to reading them, frequently pointing directly to the actual issue.

Final Thoughts

These commands cover the vast majority of everyday terminal tasks โ€” navigating the filesystem, managing files, searching content, and checking system information. Building genuine muscle memory with these fundamentals through regular practice makes the terminal feel significantly less intimidating and considerably more efficient than relying on graphical interfaces for the same tasks.

Frequently Asked Questions

What is the difference between cp and mv in Linux?

cp copies a file or directory while keeping the original in place, while mv moves a file or directory to a new location (or renames it), removing it from its original location.

Is it dangerous to use rm -rf?

Yes, it should be used with genuine caution since it force-removes files and directories without confirmation and without any recycle bin recovery option, so always double-check the target path before running it.

What's the best way to learn Linux commands as a complete beginner?

Practice regularly in a safe environment like a virtual machine, use the man command to look up unfamiliar commands, and gradually build muscle memory through consistent, hands-on repetition rather than just reading references.

Like what you read? I also build production systems for businesses.

Let's work together