-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Skatterbrainz edited this page Dec 28, 2025
·
2 revisions
- File System Operations
- Navigation & Directory
- File Permissions
- Search & Find
- Text Processing
- Archive & Compression
- Network Operations
- Process Management
- System Information
- Disk Usage & Management
- Package Management
- Environment & Variables
| Command | Examples |
|---|---|
| ls |
ls -lals -lh /homels *.txt
|
| cp |
cp file1.txt file2.txtcp -r /source/dir /dest/dircp *.jpg /backup/
|
| mv |
mv oldfile.txt newfile.txtmv file.txt /new/location/mv *.log /logs/
|
| rm |
rm file.txtrm -rf directory/rm -i *.tmp
|
| touch |
touch newfile.txttouch file1 file2 file3touch -t 202301011200 file.txt
|
| ln |
ln -s /path/to/file symlinkln file.txt hardlink.txtln -sf /usr/bin/python3 /usr/bin/python
|
| Command | Examples |
|---|---|
| cd |
cd /home/usercd ..cd ~/Documents
|
| pwd |
pwdpwd -P
|
| mkdir |
mkdir newdirmkdir -p path/to/nested/dirmkdir -m 755 secure_dir
|
| rmdir |
rmdir empty_dirrmdir -p dir1/dir2/dir3
|
| tree |
treetree -L 2tree -a -I '.git'
|
| Command | Examples |
|---|---|
| chmod |
chmod 755 script.shchmod u+x file.shchmod -R 644 /var/www/
|
| chown |
chown user:group file.txtchown -R www-data:www-data /var/wwwchown root file.txt
|
| chgrp |
chgrp staff file.txtchgrp -R developers /project
|
| umask |
umask 022umask -S
|
| Command | Examples |
|---|---|
| find |
find /home -name "*.txt"find . -type f -mtime -7find /var -size +100M
|
| grep |
grep "pattern" file.txtgrep -r "error" /var/log/grep -i "warning" *.log
|
| locate |
locate nginx.conflocate -i "*.PDF"
|
| which |
which python3which -a gcc
|
| whereis |
whereis nginxwhereis -b python
|
| Command | Examples |
|---|---|
| cat |
cat file.txtcat file1 file2 > combined.txtcat -n script.sh
|
| less |
less largefile.logless +G file.txt
|
| head |
head -10 file.txthead -c 100 binary.dat
|
| tail |
tail -f /var/log/syslogtail -20 error.logtail -n +10 file.txt
|
| sort |
sort names.txtsort -n numbers.txtsort -r -k2 data.csv
|
| uniq |
sort file.txt | uniquniq -c sorted.txt
|
| cut |
cut -d',' -f1,3 data.csvcut -c1-10 file.txt
|
| awk |
awk '{print $1}' file.txtawk -F',' '{print $2}' data.csv
|
| sed |
sed 's/old/new/g' file.txtsed -i '1d' file.txt
|
| Command | Examples |
|---|---|
| tar |
tar -czf archive.tar.gz folder/tar -xzf archive.tar.gztar -tzf archive.tar.gz
|
| zip |
zip -r archive.zip folder/zip archive.zip file1 file2
|
| unzip |
unzip archive.zipunzip -l archive.zipunzip archive.zip -d /target/
|
| gzip |
gzip file.txtgzip -d file.txt.gz
|
| Command | Examples |
|---|---|
| ping |
ping google.comping -c 4 ***********
|
| wget |
wget https://example.com/file.zipwget -r -np https://site.com/dir/
|
| curl |
curl https://api.example.com/datacurl -X POST -d "data" url.comcurl -o file.html https://site.com
|
| ssh |
ssh user@server.comssh -i key.pem user@host
|
| scp |
scp file.txt user@host:/path/scp -r folder/ user@host:~
|
| netstat |
netstat -tulpnnetstat -i
|
| ss |
ss -tulpnss -s
|
| Command | Examples |
|---|---|
| ps |
ps auxps -ef | grep nginxps --forest
|
| top |
toptop -u username
|
| htop |
htophtop -u user
|
| kill |
kill 1234kill -9 1234kill -TERM 1234
|
| killall |
killall firefoxkillall -9 chrome
|
| jobs |
jobsjobs -l
|
| nohup |
nohup ./script.sh &nohup python app.py > app.log &
|
| Command | Examples |
|---|---|
| uname |
uname -auname -r
|
| whoami | whoami |
| id |
idid username
|
| uptime |
uptimeuptime -p
|
| free |
free -hfree -m
|
| lscpu |
lscpulscpu | grep "Model name"
|
| lsblk |
lsblklsblk -f
|
| Command | Examples |
|---|---|
| df |
df -hdf -i
|
| du |
du -sh /home/userdu -ah . | sort -hrdu -d 1 /var/
|
| mount |
mount /dev/sdb1 /mntmount -t ext4 /dev/sdc1 /backup
|
| umount |
umount /mntumount /dev/sdb1
|
| fdisk |
fdisk -lfdisk /dev/sdb
|
| Command | Examples |
|---|---|
| apt |
apt update && apt upgradeapt install nginxapt search python
|
| apt-get |
apt-get updateapt-get install -y gitapt-get remove package
|
| dpkg |
dpkg -i package.debdpkg -l | grep nginxdpkg -r package
|
| snap |
snap install code --classicsnap listsnap refresh
|
| Command | Examples |
|---|---|
| env |
envenv | grep PATH
|
| export |
export PATH=$PATH:/new/pathexport API_KEY="secret123"
|
| echo |
echo $HOMEecho "Hello World"echo $PATH | tr ':' '\n'
|
| alias |
alias ll='ls -la'aliasunalias ll
|
| history |
historyhistory | grep git!42
|
- Use
man commandfor detailed documentation - Press Tab for auto-completion
- Use Ctrl+C to stop running commands
- Combine commands with pipes (|) and redirections (>, >>)
- Use
--helpflag for quick command options
Generated for Linux enthusiasts π§ | Remember: with great power comes great responsibility!