Basic commands

This guide covers essential Linux commands that every user should know.

πŸ“‚ File and Directory Navigation

Directory Navigation

pwd                     # Print working directory
cd /path/to/directory   # Change directory
cd ..                   # Go up one directory
cd ~                    # Go to home directory
cd -                    # Go to previous directory

Listing Files and Directories

ls                      # List files and directories
ls -l                   # Long format listing
ls -a                   # Show hidden files
ls -lh                  # Human-readable file sizes
ls -R                   # Recursive listing
ls -lt                  # Sort by modification time

File Operations

πŸ“ File Viewing and Editing

View File Contents

Text Processing

πŸ’» System Information

System Status

User Information

πŸ”„ Process Management

Process Control

🌐 Network Commands

Network Information

πŸ’‘ Tips and Tricks

  1. Command History

  2. Keyboard Shortcuts

  • Ctrl + C: Interrupt current process

  • Ctrl + Z: Suspend current process

  • Ctrl + D: Exit current shell

  • Ctrl + L: Clear screen

  • Ctrl + A: Go to beginning of line

  • Ctrl + E: Go to end of line

  1. Command Help

🎯 Best Practices

  1. Safety First

    • Use -i flag with rm for interactive deletion

    • Make backups before major operations

    • Test commands with sample data first

  2. Efficiency

    • Use tab completion

    • Learn keyboard shortcuts

    • Create aliases for common commands

  3. Organization

    • Keep home directory organized

    • Use meaningful file names

    • Document complex commands

🚫 Common Mistakes to Avoid

  1. Running commands without understanding them

  2. Using rm -rf without careful consideration

  3. Running commands as root unnecessarily

  4. Forgetting to backup important data

  5. Not using command history effectively

Last updated

Was this helpful?