Which terminal commands should you know as a Linux user?

Angelo Elmer
538 Words
2:25 Minutes

The modern Linux distributions let the user operate the system completely with a mouse and keyboard. Gone are the days when you had to guess commands in the terminal to create a file or open a program.

Some Linux commands should be known by every Linux user. It doesn't matter if it's a Linux operating system with or without a user interface.

  • sudo -s
    sudo -s is considered the most powerful command in Linux. It gives you root access to any system. If you do not have sudo privileges, you cannot install software or change system settings. You must use sudo before running any command.
  • sudo apt update
    This gives you full access to the Internet and allows you to download updates for your Debian or Ubuntu operating system.
  • sudo apt install
    This will install any program available in the Debian or Ubuntu repository onto your system.
  • sudo apt remove
    This can be used to remove any program that was installed using the apt-get install command.
  • sudo dnf update
    This can be used to download updates for RHEL operating systems from Red Hat. To install the updates, you must then run sudo upgrade.
  • sudo dnf install
    With this command, you can install a program on a RHEL system.
  • sudo dnf remove
    If you don't need a program, you can uninstall it on a RHEL system with the sudo dnf remove command.
  • cd
    The cd command changes the current directory and moves the cursor to that location. If you enter an incorrect directory name, the system will notify you of the error and prompt you to try again.
  • grep
    The grep command searches the contents of a file or text stream for specific strings. It is often used to look for patterns in log files.
  • man
    The man command opens a manual page for each command you type in the terminal window.
  • pkill
    The pkill command can be used to close any program that is currently open.
  • pwd
    pwd stands for the current working directory. This command shows you the current location of your terminal. To return to where you were, type cd (tilde), followed by a space, and the return key.
  • ls
    ls lists files and directories in the current directory. Type ls -a to list hidden files as well.
  • cp
    The cp command copies files and directories. Use it to move files between directories.
  • rm
    Use this command to delete a file or directory. The "-r" option is required to delete a directory that contains files.
  • mkdir
    Use this command to create a new directory.
  • cat
    The cat command can be used to display the contents of a file or to create a file.
  • exit
    This command logs off the current user in the terminal. If you are a superuser, you become a normal user after logging out. If you are already a normal user, you leave the terminal.
  • restart
    To restart the computer, simply use the "restart" command. The current session is terminated and the computer restarts.
  • shutdown -h now
    This command initiates the shutdown process of the computer. No special rights are required for this.

As a Linux user, you should never rely on the graphical user interface. If, for example, the user interface is no longer usable after a faulty update, the only option left is to repair the system with the terminal.

Angelo Elmer

About Angelo Elmer

Angelo Elmer, a wordsmith with a passion for storytelling, has mastered the art of telling multi-layered stories. His adaptable writing style translates seamlessly to a variety of topics and delivers informative and engaging content.

Redirection running... 5

You are redirected to the target page, please wait.