The Linux command line is a powerful and efficient way to interact with your system. This reference guide covers 20 essential commands that provide a solid foundation for navigating and performing basic tasks in Linux.

Så här gör du

  1. Steg 1: List Files and Directories (ls)

    Show the contents of the current directory.

    ls
  2. Steg 2: Change Directory (cd)

    Move to a different directory.

    cd /path/to/directory
  3. Steg 3: Print Working Directory (pwd)

    Display the current directory path.

    pwd
  4. Steg 4: Copy Files (cp)

    Copy files from one location to another.

    cp source destination
  5. Steg 5: Move or Rename Files (mv)

    Move files or rename them.

    mv oldname newname
  6. Steg 6: Remove/Delete Files (rm)

    Delete files. Be cautious; this action is irreversible.

    rm filename
  7. Steg 7: Make Directory (mkdir)

    Create a new directory.

    mkdir directoryname
  8. Steg 8: Remove Directory (rmdir)

    Delete an empty directory.

    rmdir directoryname
  9. Steg 9: Concatenate and Display File Content (cat)

    Display the entire content of a file.

    cat filename
  10. Steg 10: Text Editor (nano)

    Open a simple text editor for creating or editing files.

    nano filename
  11. Steg 11: Manual Pages (man)

    Access the manual pages for a command to learn more about its usage.

    man command_name
  12. Steg 12: Process Status (ps)

    Display information about running processes.

    ps
  13. Steg 13: Terminate a Process (kill)

    Terminate a running process using its process ID (PID).

    kill PID
  14. Steg 14: Disk Free (df)

    Display information about disk space usage.

    df -h
  15. Steg 15: Disk Usage (du)

    Show the disk usage of files and directories.

    du -h
  16. Steg 16: Change File Permissions (chmod)

    Modify the permissions of a file or directory.

    chmod permissions filename
  17. Steg 17: Superuser (sudo)

    Execute a command with administrative privileges.

    sudo command
  18. Steg 18: Command History (history)

    View a list of recently executed commands.

    history
  19. Steg 19: Search Text (grep)

    Search for a specific pattern in a file.

    grep pattern filename
  20. Steg 20: Exit the Terminal (exit)

    Close the terminal session.

    exit

Important: Use caution with commands like rm and sudo, as they can have significant consequences if used incorrectly.