Beginner's Guide to Essential Linux Commands
1. free - Check Memory Usage
- Displays available and used memory (RAM).
- Helps troubleshoot high memory usage issues.
Command: free -h
2. df - Check Disk Space
- Shows available and used disk space on mounted filesystems.
Command: df -h
3. du - Check Folder Size
- Shows disk usage of directories.
- Helps find which folders take up the most space.
Command: du -sh /home/*
4. ps - View Running Processes
- Lists all running processes.
Command: ps aux
5. kill - Stop a Process
- Terminates a running process by its Process ID (PID).
Command: kill -9 <PID>
6. uptime - Check System Uptime
- Shows how long the system has been running.
Command: uptime
7. who - See Logged-in Users
- Lists all users currently logged into the system.
Command: who
8. w - Detailed Logged-in User Info
- Shows logged-in users and their activity.
Command: w
9. hostname - Show System Name
- Displays the system's hostname.
Command: hostname
10. lsblk - List Block Devices
- Lists disks and partitions in a tree structure.
Command: lsblk
11. blkid - Get Filesystem Type
- Shows UUID and filesystem type of a disk.
Command: blkid /dev/sdb1
12. dmesg - View System Logs
- Displays kernel logs, useful for troubleshooting hardware issues.
Command: dmesg | tail -20
13. reboot - Restart the System
- Reboots the system.
Command: reboot
14. shutdown - Power Off the System
- Shuts down the system safely.
Command: shutdown -h now