0% found this document useful (0 votes)
11 views2 pages

Linux Commands Cheat Sheet

This document is a cheat sheet for Linux commands, organized into categories such as file and directory commands, file viewing and editing, search and find, permissions and ownership, package management, system info and monitoring, compression, networking, and others. Each category lists essential commands along with brief descriptions of their functions. It serves as a quick reference guide for users to efficiently navigate and utilize Linux commands.

Uploaded by

Mirza Arif baig
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views2 pages

Linux Commands Cheat Sheet

This document is a cheat sheet for Linux commands, organized into categories such as file and directory commands, file viewing and editing, search and find, permissions and ownership, package management, system info and monitoring, compression, networking, and others. Each category lists essential commands along with brief descriptions of their functions. It serves as a quick reference guide for users to efficiently navigate and utilize Linux commands.

Uploaded by

Mirza Arif baig
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Linux Commands Cheat Sheet

1. File & Directory Commands

pwd - Print current directory


ls - List files
cd - Change directory
mkdir - Make directory
rmdir - Remove empty directory
touch file.txt - Create a blank file
cp a.txt b.txt - Copy file
mv a.txt b.txt - Move/rename file
rm file.txt - Remove file
clear - Clears terminal

2. File Viewing & Editing

cat file.txt - Show file content


nano file.txt - Edit file (easy editor)
less file.txt - View file one page at a time
head file.txt - Show top lines
tail file.txt - Show bottom lines

3. Search & Find

find . -name file.txt - Find a file


grep 'word' file.txt - Search for word
locate file.txt - Fast find using DB

4. Permissions & Ownership

chmod 755 file - Change permissions


chown user file - Change file owner
ls -l - See file permissions

5. Package Management (Ubuntu/Debian)

sudo apt update - Update package list


sudo apt upgrade - Upgrade installed packages
sudo apt install packagename - Install package
sudo apt remove packagename - Uninstall package

6. System Info & Monitoring

top - Live processes


Linux Commands Cheat Sheet

htop - Better version of top (needs install)


ps aux - List all processes
df -h - Disk space (human readable)
du -sh folder/ - Folder size
free -h - RAM usage
uname -a - System info
uptime - How long system has been on

7. Compression

tar -cvf file.tar folder/ - Create .tar archive


tar -xvf file.tar - Extract .tar archive
zip -r file.zip folder/ - Zip folder
unzip file.zip - Unzip file

8. Networking

ping google.com - Test internet connection


ifconfig - Show IP address (old)
ip a - Show IP address (new)
netstat -tuln - Show listening ports
curl example.com - Fetch URL content

9. Others

history - Show previous commands


alias ll='ls -alF' - Create shortcut
man command - Show manual (help)
whoami - Show your username
sudo - Run command as admin

You might also like