Linux Commands Reference Guide

Complete beginner to advanced command reference

File Management Commands

ls - List directory contents

The ls command is used to list files and directories in Linux. It is one of the most commonly used commands.

ls ls -la

cd - Change directory

The cd command allows you to move between directories.

cd /var/www/html

pwd - Print working directory

Shows your current directory path.

pwd

cp - Copy files

Copies files and directories.

cp file.txt backup.txt

mv - Move or rename

Moves or renames files.

mv old.txt new.txt

rm - Remove files

Deletes files and directories.

rm file.txt rm -rf folder

Network Commands

ping

Tests connectivity between your machine and another host.

ping google.com

curl

Transfers data from or to a server.

curl https://example.com

wget

Downloads files from the internet.

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

netstat

Displays network connections and listening ports.

netstat -tulnp

Process Management

ps

Displays running processes.

ps aux

top

Shows real-time system usage.

top

htop

Interactive process viewer (if installed).

htop

kill

Terminates processes by PID.

kill 1234

System Information

uname

Displays system information.

uname -a

df

Shows disk usage.

df -h

free

Displays memory usage.

free -m

whoami

Shows current logged-in user.

whoami