Linux-Commands
Introduction
Welcome to the Linux Commands Reference guide! This comprehensive guide provides detailed documentation for essential Linux commands, including syntax, options, practical examples, and best practices.
Command Documentation Template
Each command is documented following this consistent template:
- Command Overview - Brief description of the command’s purpose
- Syntax - Basic command syntax and structure
- Common Options - Table of frequently used options
- Key Use Cases - Primary applications and scenarios
- Examples with Explanations - Practical examples with detailed explanations
- Understanding Output - Explanation of command output fields
- Common Usage Patterns - Typical usage scenarios and patterns
- Performance Analysis - Tips for performance monitoring and analysis
- Related Commands - Other relevant commands
- Additional Resources - References and further reading
Command Categories
1. Help and Documentation
man
- Manual pages for commandsinfo
- View command informationhelp
- Display help for shell builtinswhatis
- Display one-line command descriptionsapropos
- Search manual page names and descriptions
2. File and Directory Management
ls
- List directory contentscd
- Change directorypwd
- Print working directorymkdir
- Make directoriesrmdir
- Remove empty directoriescp
- Copy files and directoriesmv
- Move/rename filesrm
- Remove files or directoriestouch
- Create empty files/update timestampscat
- Concatenate and display fileshead
- Output the first part of filestail
- Output the last part of filesless
- View file contents interactivelymore
- View file contents page by pagetree
- Display directory structurefind
- Search for fileslocate
- Find files by namewhich
- Show full path of commandswhereis
- Locate binary, source, and manual files
3. Archiving and Compression
tar
- Archive filesgzip
- Compress filesbzip2
- Block-sorting file compressorzip/unzip
- Package and compress filescpio
- Copy files to and from archivesdd
- Convert and copy filesdump/restore
- Backup and restore utilities
4. System Information
uname
- Print system informationhostname
- Show or set system host namehostnamectl
- Control system hostnamedf
- Report file system disk space usagedu
- Estimate file space usagefree
- Display memory usagelsdev
- Display information about installed hardwarelsmod
- Show status of kernel moduleslspci
- List PCI deviceslsusb
- List USB deviceshwinfo
- Hardware information tooluptime
- Show system running time
5. Process Management
ps
- Report process statustop
- Display system processeshtop
- Interactive process viewerkill
- Terminate processeskillall
- Kill processes by namepkill
- Signal processes based on namepgrep
- List processes based on namenice
- Run with modified scheduling priorityrenice
- Alter process prioritypidof
- Find process ID of a programpstree
- Display process treechroot
- Run command with special root directory
6. System Monitoring
atop
- Advanced system and process monitoriostat
- Report CPU and I/O statisticsmpstat
- Report processor related statisticsvmstat
- Report virtual memory statisticssar
- Collect and report system activitynfsstat
- NFS statisticslsof
- List open filestraceroute
- Print network routew
- Show who is logged in and what they’re doing
7. User and Group Management
useradd
- Create new userusermod
- Modify user accountuserdel
- Delete user accountgroupadd
- Create new groupgroupmod
- Modify group definitiongroupdel
- Delete grouppasswd
- Change user passwordchown
- Change file owner and groupchmod
- Change file permissionsid
- Print user and group IDswho
- Show who is logged inw
- Show logged in users and activitylast
- Show listing of last logged in userssu
- Switch usersudo
- Execute command as another user
8. Networking
ping
- Test network connectivityifconfig
- Configure network interfaceip
- Show/manipulate routing, devices, policy routingnetstat
- Network statisticsss
- Socket statisticsroute
- Show/manipulate IP routing tablearp
- Manipulate ARP cachedig
- DNS lookup utilitynslookup
- Query DNShost
- DNS lookup utilitywhois
- Domain information groperssh
- Secure shell clientscp
- Secure copyrsync
- Remote file copy utilityftp
- File transfer protocolwget
- Network downloadercurl
- Transfer data from/to servertcpdump
- Network packet analyzernmap
- Network exploration tooltraceroute
- Print the route packets tracemtr
- Network diagnostic tool
9. File System Management
mount
- Mount a filesystemumount
- Unmount a filesystemfsck
- Check and repair filesystemmkfs
- Build a Linux filesystemmke2fs
- Create ext2/ext3/ext4 filesystemdf
- Report filesystem disk space usagedu
- Estimate file space usageswapon/swapoff
- Enable/disable swap space
10. System Runtime
shutdown
- Bring system downreboot
- Restart systempoweroff
- Power off systeminit
- Process control initializationrunlevel
- Print previous and current runlevelhalt
- Stop system
11. Scheduling
at
- Execute commands at specified timeatq
- List pending jobsatrm
- Remove jobsbatch
- Execute commands when load permitscrontab
- Schedule periodic background work
12. Logging
logger
- Make entries in system logklogd
- Kernel log daemonsyslogd
- System log daemonsysklog
- System and kernel log daemon
13. Hardware Management
lshw
- List hardwarelspci
- List PCI deviceslsusb
- List USB deviceslshal
- List HAL deviceseject
- Eject removable media
14. Printing
lp
- Print fileslpq
- Show printer queuelprm
- Remove print jobslpstat
- Print system status
15. Package Management
rpm
- RPM Package Manageryum
- Package manager for RPM systems