Linux Commands
Linux command‑line tools are the backbone of reconnaissance, exploitation, and post‑exploitation on Unix‑like systems.
Common Commands
Navigation & File Management
Command |
Description
|
pwd |
Print working directory
|
cd |
Change directory
|
ls |
List directory contents
|
mkdir |
Create directory
|
rmdir |
Remove empty directory
|
cp |
Copy files or directories
|
mv |
Move or rename files/directories
|
rm |
Delete files or directories
|
Viewing & Text Processing
Command |
Description
|
cat |
Concatenate & display files
|
less |
Paginate large files
|
head |
Show first lines of a file
|
tail |
Show last lines / follow file
|
grep |
Search for patterns
|
System & User Info
Command |
Description
|
whoami |
Show current user
|
id |
Display user/group IDs
|
df |
Disk usage overview
|
history |
List previously executed commands
|
Networking
Command |
Description
|
ping |
Test network connectivity (ICMP)
|
curl |
Retrieve data from URLs / APIs
|
ssh |
Secure remote shell & tunnelling
|
Help & Documentation
Command |
Description
|
man |
Read manual pages
|
echo |
Display text / variables
|
Examples
Print Working Directory
↑ Commands
Change Directory
↑ Commands
List All Files (long + hidden)
↑ Commands
Create Directory
↑ Commands
Remove Empty Directory
↑ Commands
Copy File
cp secrets.txt /tmp/secrets.bak
↑ Commands
Move & Rename
mv old.log archive/old.log
↑ Commands
Force‑Delete Directory
↑ Commands
Show File Contents
cat /etc/passwd | grep ":/bin/bash"
↑ Commands
View Large Log
↑ Commands
First 10 Lines
↑ Commands
Follow File Growth
tail -f /var/log/nginx/access.log
↑ Commands
Search Pattern
↑ Commands
Current User
↑ Commands
User & Group IDs
↑ Commands
Human‑Readable Disk Usage
↑ Commands
Show Last 20 Commands
↑ Commands
Ping Host 4 Times
↑ Commands
Download Web Page
curl -o index.html http://example.com
↑ Commands
SSH on Custom Port
↑ Commands
Read Manual Page
↑ Commands
Write to File
echo \"hacked\" > /tmp/proof.txt
↑ Commands
See Also