
๐Navigation and File Management
Command | Description |
ls | List files and directories in the current directory. |
cd directory | Change to the specified directory. |
pwd | Print the current working directory path. |
mkdir directory | Create a new directory. |
rm file | Remove/delete a file. |
rm -r directory | Remove a directory and its contents. |
cp source dest | Copy files/directories from source to destination. |
mv source dest | Move/rename files/directories. |
find directory -name filename | Search for files by name. |
๐Text Processing and Viewing
Command | Description |
cat file | Display the contents of a file. |
grep pattern file | Search for a pattern in a file. |
less file | View file contents interactively. |
head -n lines file | Display the first N lines of a file. |
tail -n lines file | Display the last N lines of a file. |
sort file | Sort lines in a file. |
sed 's/old/new/' file | Stream editor for text manipulation. |
awk '{ print $1 }' file | Process and extract data from text files. |
Command | Description |
ps | Display a list of currently running processes. |
top | Monitor system processes and resource usage. |
df -h | Display disk space usage in human-readable format. |
du -h directory | Display directory space usage in human-readable format. |
free -h | Display memory usage. |
uptime | Display system uptime and load averages. |
netstat -tuln | List open network ports. |
who | Display users currently logged in. |
w | Display detailed information about logged-in users. |
htop | Interactive process viewer. |
๐Permissions and Users
Command | Description |
chmod permissions file | Change file permissions. |
chown user:group file | Change file ownership. |
passwd | Change the user password. |
useradd username | Create a new user. |
usermod -aG group username | Add the user to a group. |
su username | Switch user or become superuser. |
sudo command | Execute a command with superuser privileges. |
groups username | Display groups a user belongs to. |
id username | Display user and group information. |
๐Network and Connectivity
Command | Description |
ifconfig | Display network interface information. |
ip addr | Display IP addresses and network interfaces. |
ping hostname | Send ICMP echo requests to a host. |
nslookup domain | Look up DNS information for a domain. |
ssh user@hostname | Connect to a remote server using SSH. |
scp source dest | Securely copy files between hosts. |
curl URL | Transfer data to or from a server. |
wget URL | Download files from the internet. |
๐Package Management
Command | Description |
apt-get install pkg | Install a package using APT (Debian/Ubuntu). |
yum install pkg | Install a package using YUM (CentOS/RHEL). |
dnf install pkg | Install a package using DNF (Fedora). |
apt-get update | Update package information (APT). |
yum update | Update installed packages (YUM). |
dnf update | Update installed packages (DNF). |
apt-cache search pkg | Search for a package (APT). |
rpm -qa | List all installed packages (RPM). |
๐Miscellaneous
Command | Description |
date | Display the current date and time. |
cal | Display a calendar. |
echo text | Print text to the terminal. |
history | Display the command history. |
man command | Display the manual page for a command. |
alias | Create custom command shortcuts. |
shutdown | Shut down or restart the system. |
reboot | Reboot the system. |
uname -a | Display system information. |
๐ Conclusion:
Congratulations! ๐
This comprehensive cheat sheet covers a variety of Linux commands categorized into different sections. Feel free to print or save it for quick reference! Remember to explore the manual pages (man command
) for more detailed information on each command.
We hope this blog has given you a Question/Answer ๐๐ช
๐ Did you find this blog helpful? Let us know in the comments below! ๐ And if you have any questions or need further assistance, we're here to help! ๐ค
Happy Learning! ๐ปโจ