Basic and Useful Linux Commands
Navigation & Help
pwd - Print working directory
ls - List files and directories
cd - Change directory
man [command] - Show manual/help for a command
clear - Clear the terminal screen
File & Directory Operations
touch filename - Create a new empty file
mkdir dirname - Create a new directory
cp source destination - Copy files or directories
mv source destination - Move or rename files or directories
rm filename - Delete a file
rm -r dirname - Delete a directory and its contents
Viewing Files
cat filename - View contents of a file
less filename - Scroll through file content
head filename - View the first 10 lines
tail filename - View the last 10 lines
nano filename - Open file in simple text editor
Searching
find /path -name "file.txt" - Find files by name
grep "text" filename - Search for text in a file
Permissions & Ownership
chmod 755 file - Change file permissions
chown user:group file - Change file ownership
ls -l - List files with permissions and ownership info
Basic and Useful Linux Commands
System Info & Package Management
uname -a - System information
df -h - Disk space usage
top - View running processes
ps aux - List all processes
sudo apt update - Update package lists
sudo apt install package - Install a package
Networking
ping google.com - Test internet connection
ifconfig - Show IP address and network info
ip a - Show IP address and network info (modern)
netstat -tuln - Show listening ports
curl example.com - Fetch content from a URL