BASIC LIBNUX COMMANDS AND TOOLS
1. File & Directory Management
| Command | Description | Example |
|---|---|---|
pwd | Show current directory | pwd |
ls | List files | ls -l |
cd | Change directory | cd /home/user |
mkdir | Create directory | mkdir test |
rmdir | Remove empty directory | rmdir test |
rm | Remove file/directory | rm file.txt |
cp | Copy files | cp file.txt backup.txt |
mv | Move/rename files | mv old.txt new.txt |
touch | Create empty file | touch file.txt |
find | Search files | find . -name file.txt |
2. File Viewing & Editing
| Command | Description | Example |
|---|---|---|
cat | Display file content | cat file.txt |
less | View file page by page | less file.txt |
head | First 10 lines | head file.txt |
tail | Last 10 lines | tail file.txt |
nano | Simple text editor | nano file.txt |
vim | Advanced editor | vim file.txt |
3. Search & Text Processing
| Command | Description | Example |
|---|---|---|
grep | Search text in files | grep "word" file.txt |
sort | Sort lines | sort file.txt |
uniq | Remove duplicates | uniq file.txt |
wc | Count words/lines | wc -l file.txt |
cut | Extract columns | cut -d',' -f1 file.csv |
awk | Text processing | awk '{print $1}' file.txt |
sed | Stream editor | sed 's/old/new/' file.txt |
4. User & Permission Management
| Command | Description | Example |
|---|---|---|
whoami | Current user | whoami |
id | User ID info | id |
chmod | Change permissions | chmod 755 file.sh |
chown | Change ownership | chown user file.txt |
sudo | Run as admin | sudo apt update |
5. System Monitoring
| Command | Description | Example |
|---|---|---|
top | Real-time processes | top |
htop | Enhanced process viewer | htop |
ps | Process status | ps aux |
df | Disk space | df -h |
du | Directory size | du -sh folder |
free | Memory usage | free -h |
uptime | System running time | uptime |
6. Networking
| Command | Description | Example |
|---|---|---|
ping | Test connectivity | ping google.com |
ifconfig | Network config (older) | ifconfig |
ip | Network management | ip addr |
netstat | Network status | netstat -tuln |
ss | Socket statistics | ss -tuln |
curl | Transfer data | curl example.com |
wget | Download files | wget file_url |
Helpful Shortcuts
Ctrl + C → Stop process
Ctrl + Z → Suspend process
Tab → Auto-complete
history → Show command history
clear → Clear terminal
mkdir | Create directory | mkdir test |
mkdir jo
sudo | Run as admin | sudo apt update |
open "nano" text Editor
sudo nmap -sn 192.168.1.0/24
Meaning:
Starting Nmap 7.95
→ The program has started running.
→ You are using Nmap version 7.95.https://nmap.org
→ Official Nmap website.2026-02-12 05:38 EST
→ Date and time when the scan started.
→ EST = Eastern Standard Time.
No comments:
Post a Comment