Command | Description | Example |
---|---|---|
| Print current directory |
|
| List directory contents |
|
| List contents with details |
|
| Include hidden files in listing |
|
| Change directory |
|
| Move up one directory |
|
| Go to the home directory |
|
| Create a new directory |
|
| Delete a file |
|
| Remove a directory and contents |
|
| Copy files or directories |
|
| Move or rename files or directories |
|
📝 File Operations
Command | Description | Example |
---|---|---|
| Display file contents |
|
| View contents with scroll option |
|
| Show the first n lines of a file |
|
| Show the last n lines of a file |
|
| Open file in nano editor |
|
| Open file in vim editor |
|
🔍 Search for Files and Text
Command | Description | Example |
---|---|---|
| Find files by name in a path |
|
| Quickly locate files (uses index) |
|
| Search text within a file |
|
| Recursively search text in a directory |
|
📦 Package Management with APT
Command | Description | Example |
---|---|---|
| Refresh list of available packages |
|
| Install updates for all installed packages |
|
| Install a specific package |
|
| Uninstall a specific package |
|
| Manually install a .deb package |
|
🔒 Permissions and Ownership
Command | Description | Example |
---|---|---|
| Change permissions (rwx) for a file |
|
| Change ownership of a file or directory |
|
| Change ownership for directory and contents |
|
Example of Permissions with chmod
Each number in chmod
represents permissions for Owner, Group, and Others:
Number | Permissions | Meaning |
---|---|---|
7 |
| Read, Write, Execute |
5 |
| Read, Execute |
6 |
| Read, Write |
4 |
| Read only |
Examples
chmod 755 file.sh
→ Owner has full access (7
=rwx
); group and others can read and execute (5
=r-x
).chmod 644 file.sh
→ Owner can read and write (6
=rw-
); group and others can only read (4
=r--
).
📊 System Monitoring
Command | Description | Example |
---|---|---|
| Monitor running processes in real-time |
|
| Colorized view of running processes |
|
| Show disk usage in human-readable format |
|
| Show size of a directory |
|
| Show memory usage |
|
| Display system information |
|
| Show all running processes |
|
🌐 Network Essentials
Command | Description | Example |
---|---|---|
| Show network interface configuration |
|
| List IP addresses of interfaces |
|
| Check connectivity to a host |
|
| List open ports |
|
| Fetch data from a URL |
|
| Download files from a URL |
|
💾 File Compression and Archiving
Command | Description | Example |
---|---|---|
| Create a .tar archive of a directory |
|
| Extract contents of a .tar archive |
|
| Compress a file |
|
| Decompress a .gz file |
|
| Compress files into a .zip archive |
|
| Extract contents of a .zip file |
|
🔧 Process Management
Command | Description | Example |
---|---|---|
| Terminate a process by its ID |
|
| Terminate a process by name |
|
| Move a job to the background |
|
| Bring a background job to the foreground |
|
| List background jobs |
|
⏰ Scheduling with Cron
Command | Description | Example |
---|---|---|
| Edit the current user’s cron jobs |
|
Cron syntax |
|
|
🔑 SSH & Remote Access
Command | Description | Example |
---|---|---|
| Connect to a remote system |
|
| Copy files to a remote system |
|
| Sync files between local and remote systems |
|
Post a Comment