Kiran Reddy Bokkala
Linux cheat sheet & self understanding ways of commands
NOTE: For every command in Linux, it will have man pages and help option which will help you to
understand more about the usage of command and possible flags to use.
For example, I want to use useradd command, but I am not sure about the flags, then you check
the usage as shown below.
useradd - -help (or) useradd -h
man 1 useradd (or just) man useradd
Linux man pages are grouped into sections:
Section Description
1 User Commands (like ls, grep)
2 System Calls (like open, read)
3 Library Functions (like printf)
4 Special Files (like /dev/null)
5 File Formats (like /etc/passwd)
8 System Admin Commands (like mount, ifconfig)
If two commands have the same name, you can specify which section like 2,5,3:
For example, crontab command comes under command as well as file formatting command
man 5 crontab
man 1 crontab
• User and Group Management
• useradd – Add a new user
• usermod – Modify user account
• userdel – Delete a user
• groupadd – Create a new group
• groupdel – Delete a group
• passwd – Change user password
• id – Show user and group IDs
• groups – Show groups of a user
• Process Management
• ps – Display running processes
• top – Monitor real-time processes
• htop – Interactive process viewer (better top)
• kill – Send signal to a process (usually to terminate)
• killall – Kill processes by name
• nice – Start a process with a set priority
• renice – Change priority of a running process
• bg – Resume suspended jobs in background
• fg – Resume jobs in foreground
• Logging
• dmesg – View kernel ring buffer logs
• journalctl – Query and view systemd logs
• tail -f /var/log/syslog – Live view of system logs
• cat /var/log/auth.log – View authentication logs
• less /var/log/messages – Browse system messages log
• Monitoring
• vmstat – Report system performance
• iostat – Show CPU and disk I/O statistics
• free -h – Display memory usage
• uptime – Show system uptime and load
• sar – Collect, report, or save system activity
• Permissions Management
• chmod – Change file permissions
• chown – Change file owner and group
• chgrp – Change group ownership
• umask – Set default permissions for new files
• File Management
• cp – Copy files and directories
• mv – Move/rename files and directories
• rm – Delete files and directories
• mkdir – Create directories
• rmdir – Remove empty directories
• find – Search for files in a directory hierarchy
• locate – Find files by name quickly (using database)
• Logs
• (covered earlier under "Logging", but also:)
• logrotate – Manage the automatic rotation and compression of logs
• grep "error" /var/log/syslog – Search specific errors in logs
• Network Management
• ip a – Show IP addresses
• ifconfig – Display network interfaces (older way)
• ping – Test network connectivity
• traceroute – Trace route to a host
• netstat – Display network connections (deprecated; replaced by ss)
• ss – Display detailed network socket info
• curl – Transfer data from or to a server
• wget – Download files from the web
• Disk Management
• df -h – Show disk space usage
• du -sh * – Show size of directories/files
• lsblk – List information about block devices
• fdisk -l – List partition tables
• mount – Mount a filesystem
• umount – Unmount a filesystem
• Package Handling
• apt update – Update package lists (Debian/Ubuntu)
• apt upgrade – Upgrade installed packages
• apt install package – Install a package
• apt remove package – Remove a package
• yum install package – Install package (RHEL/CentOS)
• yum remove package – Remove package (RHEL/CentOS)
• Service Handling
• systemctl start service – Start a service
• systemctl stop service – Stop a service
• systemctl restart service – Restart a service
• systemctl status service – Check service status
• systemctl enable service – Enable service to start on boot
• systemctl disable service – Disable service from starting on boot
• Task Scheduling
• crontab -e – Edit cron jobs for scheduling tasks
• crontab -l – List scheduled cron jobs
• at – Schedule a one-time task
• systemctl list-timers – List active systemd timers
• Troubleshooting Commands
• ping – Check network connectivity
• traceroute – Diagnose network path
• netstat -tulnp – Check active ports and services
• dmesg | less – Check hardware errors
• journalctl -xe – View detailed error logs
• free -m – Check memory issues
• uptime – See if the server load is high