Basic Linux commands need to know for everyone.

Basic Linux commands need to know for everyone.

1. File and Directory Management:

  • ls ----List files and folders.
    \= eg: ls

  • cd ----Change directory (folder).
    \= eg: cd biren

  • pwd ----Show current directory.
    \=eg: pwd

  • mkdir ----Create a new folder.
    \=eg: mkdir biren

  • rm ----Delete files or folders.
    \=eg: rm biren

  • rmdir ----Delete an empty folder.
    \=eg: rmdir biren

  • cp ----Copy files or folders.
    \=eg: cp biren /home/birendra

  • mv ----Move or rename files or folders.
    \=eg: mv biren birendra

  • touch ----Create an empty file.
    \=eg: touch biren.txt

  • cat ----View the content of a file.
    \=eg: biren.txt

  1. System Information
  • whoami ----Show current username.

  • uname -a ----Display system information.

  • uptime ----Check how long the system has been on.

  • df -h ----Show disk space usage.

  • free -h ----Show memory (RAM) usage.

  • date ----Show current date and time.

  • top ----Display running processes.

  • clear ----Clear the terminal screen.

  1. File Permissions
  • chmod ----Change file permissions.
    \=eg: chmod 755 biren.txt

  • chown ----Change file owner.
    \=eg: chown user biren.txt

  1. Searching and Viewing
  • find ----Search for files and folders.
    \=eg: find . -name biren.txt

  • grep ----Search text in files.
    \=eg: grep "error" biren.txt

  • less ----View large files page-by-page.
    \=eg: less biren.txt

  • head ----Show the first lines of a file.
    \=eg: head biren.txt

  • tail ----Show the last lines of a file.
    \=eg: tail biren.txt

  1. Networking
  1. Process Management
  • ps ----Show running processes.
    \=eg: ps aux

  • kill ----Stop a process.
    \=eg: kill 9999

  • top ----Monitor processes in real-time.

  1. Others
  • history ----Show command history.

  • man ----Display manual for a command.
    \=eg: man ls

  • exit ----Exit the terminal.