Skip to content

Learn Operating Systems

Open Source Operating Systems and Development

  • Home
  • About
  • Privacy Policy

Linux Command Line Tutorial for Beginners

Posted on June 8, 2026June 17, 2026 By ron No Comments on Linux Command Line Tutorial for Beginners
Open Source Systems and Development

The Linux command line is one of the most powerful tools available to users and system administrators. While modern Linux distributions provide graphical interfaces, the command line offers greater flexibility, speed, and control over the operating system.

This tutorial introduces the basic Linux commands every beginner should know.

What Is the Command Line?

The command line is a text-based interface that allows users to interact with the operating system by typing commands.

In Linux, the command-line interface is commonly called the shell. The most widely used shell is Bash (Bourne Again Shell).

When you open a terminal window, you are interacting with the shell.

A typical command prompt may look like this:

ron@linux:~$

The dollar sign ($) indicates that you are logged in as a regular user.

Finding Your Current Directory

The pwd command displays your current working directory.

pwd

Example output:

/home/ron

This means you are currently in the user’s home directory.

Listing Files and Directories

The ls command displays files and directories.

ls

Example:

Documents Downloads Pictures

To display detailed information:

ls -l

To show hidden files:

ls -la

Changing Directories

Use the cd command to move between directories.

Change to the Documents directory:

cd Documents

Move up one directory:

cd ..

Return to your home directory:

cd ~

Creating Directories

Create a new directory using mkdir.

mkdir projects

Verify it exists:

ls

Creating Files

Create an empty file using touch.

touch notes.txt

View the file:

ls

Copying Files

Use the cp command to copy files.

cp notes.txt backup.txt

You now have two files:

notes.txt
backup.txt

Moving and Renaming Files

Use mv to move or rename files.

Rename a file:

mv notes.txt mynotes.txt

Move a file to another directory:

mv mynotes.txt Documents/

Removing Files

Delete a file using rm.

rm backup.txt

Be careful: deleted files generally cannot be recovered easily.

Removing Directories

Delete an empty directory:

rmdir projects

Delete a directory and its contents:

rm -r projects

Use caution with recursive deletion.

Viewing File Contents

Display a file’s contents:

cat myfile.txt

View long files one page at a time:

less myfile.txt

Press q to quit.

Displaying System Information

View your Linux kernel version:

uname -r

Display complete system information:

uname -a

Finding Files

Locate files with the find command.

Find a file named notes.txt:

find . -name notes.txt

Search the entire system:

find / -name notes.txt

Administrative privileges may be required.

Viewing Running Processes

Display running processes:

ps

View all running processes:

ps aux

A more interactive process viewer:

top

Press q to exit.

Viewing Disk Usage

Display filesystem usage:

df -h

Example output:

Filesystem      Size Used Avail Use%
/dev/sda1       100G  40G   60G  40%

The -h option makes sizes human-readable.

Viewing Memory Usage

Check memory utilization:

free -h

Example:

Mem: 8.0G 3.1G 4.9G

Downloading Files

Download files from the internet using wget.

wget https://example.com/file.zip

Or with curl:

curl -O https://example.com/file.zip

Installing Software

On Debian and Ubuntu systems:

Update package information:

sudo apt update

Upgrade installed packages:

sudo apt upgrade

Install a package:

sudo apt install nginx

On Fedora:

sudo dnf install nginx

On FreeBSD:

sudo pkg install nginx

Understanding File Permissions

Display file permissions:

ls -l

Example:

-rw-r--r-- 1 ron users 1024 file.txt

Permission types:

  • r = read
  • w = write
  • x = execute

Change permissions:

chmod 755 script.sh

Make a script executable:

chmod +x script.sh

Using Manual Pages

Most Linux commands include documentation.

View a command’s manual page:

man ls

Search within the manual using /.

Quit by pressing:

q

Useful Commands Summary

CommandPurpose
pwdShow current directory
lsList files
cdChange directory
mkdirCreate directory
touchCreate file
cpCopy file
mvMove or rename file
rmDelete file
catDisplay file contents
findSearch for files
psView processes
topMonitor processes
dfShow disk usage
freeShow memory usage
wgetDownload files
chmodChange permissions
manView documentation

Conclusion

Learning the Linux command line is one of the most valuable skills for anyone interested in Linux, system administration, software development, or cybersecurity. Although modern graphical interfaces make many tasks easier, understanding command-line tools provides greater control over the operating system and helps users work more efficiently. By mastering the commands covered in this tutorial, beginners can build a strong foundation for more advanced Linux administration and scripting tasks.

Tags: Linux

Post navigation

❮ Previous Post: Shell Scripting Tutorial for Beginners
Next Post: Understanding Device Drivers ❯

You may also like

Open Source Systems and Development
Understanding Device Drivers
June 9, 2026
Open Source Systems and Development
What Does an Operating System Actually Do?
June 16, 2026
Open Source Systems and Development
What Is Linux?
May 6, 2026
Open Source Systems and Development
Understanding File Systems
June 10, 2026

Leave a Reply Cancel reply

You must be logged in to post a comment.

Recent Posts

  • How the Linux Kernel Processes Packets
  • Network Programming with Sockets: Understanding TCP/IP Communication in Linux
  • Understanding Pipes in Unix and Linux
  • macOS: The Operating System Built on BSD Unix
  • What Is MINIX? The Small Operating System That Inspired Linux

Recent Comments

No comments to show.

Archives

  • June 2026
  • May 2026

Categories

  • History
  • Networking
  • Open Source Systems and Development
  • Scripting

Copyright © 2026 Learn Operating Systems.

Theme: Oceanly News Dark by ScriptsTown