Monday, July 8, 2024

Some essential Linux commands

Some essential Linux commands you should be familiar with:

  1. File and Directory Management:

    • ls: List directory contents.
    • cd: Change the current directory.
    • pwd: Print the current working directory.
    • mkdir: Create new directories.
    • rmdir: Remove empty directories.
    • rm: Remove files or directories.
    • cp: Copy files or directories.
    • mv: Move or rename files or directories.
    • touch: Create empty files or update the timestamp of existing files.
    • cat: Concatenate and display file content.
    • less / more: View file content one page at a time.
  2. File Permissions and Ownership:

    • chmod: Change file permissions.
    • chown: Change file ownership.
  3. File Search and Manipulation:

    • find: Search for files and directories.
    • grep: Search text using patterns.
    • sed: Stream editor for filtering and transforming text.
  4. Process Management:

    • ps: Display current processes.
    • top: Display tasks and system performance.
    • kill: Terminate processes by PID.
    • pkill: Terminate processes by name.
  5. System Information:

    • uname: Print system information.
    • df: Report file system disk space usage.
    • du: Estimate file space usage.
    • free: Display memory usage.
  6. Networking:

    • ifconfig: Configure network interfaces.
    • ping: Send ICMP ECHO_REQUEST to network hosts.
    • netstat: Network statistics.
  7. Package Management:

    • apt-get / yum: Install, update, and remove software packages (depending on the Linux distribution).
  8. Text Editors:

    • nano, vim, or emacs: Text editors to edit files directly in the terminal.

Pages