Linux Commands for Beginners

linux commands for beginners

Basic Commands

CommandDescriptionExamples
Clear terminal screenclear
Show command historyhistory 20
Display manual pageman ls
Print working directorypwd
Show current usernamewhoami

File Operations

CommandDescriptionExamples
View file contentscat file.txt
Copy files or folderscp file1.txt file2.txt
List directory contentsls -la
Create directoriesmkdir new_folder
Move or rename filesmv old.txt new.txt
Remove files or foldersrm -rf folder/
Create empty filetouch newfile.txt
Extract zip archiveunzip archive.zip
Create zip archivezip archive.zip file1.txt
Create linksln -s /target link
Change permissionschmod 755 script.sh
Change ownershipsudo chown user:group file

Text Processing

CommandDescriptionExamples
Pattern based text processingawk '{print $1}' file.txt
Search text with patterngrep "error" log.txt
Show top lineshead -20 file.txt
Stream editorsed 's/old/new/g' file.txt
Generate number sequenceseq 1 10
Sort linessort names.txt
Show bottom linestail -f log.txt
Translate charactersecho "HELLO" | tr 'A-Z' 'a-z'
Simple text editornano config.conf
Advanced text editorvim script.py
Compare files line by linediff file1.txt file2.txt
Select columns from linescut -d',' -f1 data.csv

System and Permissions

CommandDescriptionExamples
Create command shortcutalias ll='ls -la'
Change permissionschmod +x script.sh
Show command historyhistory | grep ssh
List block deviceslsblk -f
Read manual pagesman rsync
Shutdown or restart machinesudo shutdown -h now
Run as superusersudo apt update
Control servicessystemctl status ssh
Show running processesps aux | grep firefox
Terminate processkill -9 12345
Schedule recurring jobscrontab -e

Network Commands

CommandDescriptionExamples
Transfer data from or to servercurl https://api.example.com
Control NetworkManagernmcli device status
Download files from internetwget https://example.com/file.zip
Secure shell connectionssh user@192.168.1.10
Check connectivityping google.com
Show network statsnetstat -tulpn
Manage routes and devicesip addr show

Disk and Memory Commands

CommandDescriptionExamples
Disk space usagedf -h
Directory space usagedu -sh /home
List block deviceslsblk
Memory usagefree -h
Partition table utilitysudo fdisk -l
Mount filesystemsmount /dev/sda1 /mnt
Fast sync and copyrsync -avz source/ dest/
Copy disks and filesdd if=/dev/sda of=backup.img

Package Management

CommandDescriptionExamples
APT package managersudo apt install firefox
Debian package managerdpkg -i package.deb
Snap package managersnap install vlc
Flatpak apps managerflatpak install flathub org.videolan.VLC

Media Commands

CommandDescriptionExamples
Convert and record mediaffmpeg -i input.mp4 output.avi
Convert images to PDFimg2pdf *.jpg -o output.pdf
Merge or split PDF filespdftk *.pdf cat output merged.pdf
Download online videosyt-dlp https://youtube.com/watch?v=...

Tools and Utilities

CommandDescriptionExamples
Encrypt or decrypt filesgpg -c secret.txt
List open fileslsof -i :80
Perl interpreterperl -e 'print "Hello\\n"'
Python interpreterpython3 script.py
Create QR code imageqrencode -o qr.png "https://example.com"
Secure file deletionshred -uz secret.txt
Power and battery infoupower -i /org/freedesktop/UPower/devices/battery_BAT0
Secure file transferwormhole send file.txt
Copy text to clipboardecho "text" | xclip -selection c
Create shortcut aliasesalias update='sudo apt update && sudo apt upgrade'
Copied to clipboard