What does q Command do under Linux

The 15 most important Linux commands in the terminal (for beginners)

In Linux operating systems, you can do a lot very easily with terminal commands. Even if it looks very “nerdy” and unfamiliar at first glance, at some point convenience will prevail. Here are the top 15 Linux commands for beginners.

A key combination is often sufficient to open a terminal Ctrl + Alt + T. Otherwise you start it from the start menu. After the following commands you always have to press the Enter key once for them to be executed.

1. pwd - where am I

As soon as you open the terminal, you can see which user is logged on to which computer with this terminal, but you cannot see which directory you are currently in. The command changes that and shows you the current file path.

2. ls - display directory contents

As in Windows, you can use the command to display the contents of a directory. With (stands for “list”) the output is colored and clearer. With you can see the folders and files in a clear list view (parameter -l) and with a better size for people (parameter -h).

In our example you can see the output of dir, ls and ls -lh.

3. Change cd directory

As in Windows, the command changes to a specific directory (chang directory). If you want to move up one level again, just enter. You can follow this in our screenshot:

4. clear - clear the terminal

If you no longer want to see the previous commands in the terminal, enter. To see the commands again, you can simply scroll up again. Alternatively, you press the key combination Ctrl + L.

5. Find out whatis program info

If you find a program but don't know what it's good for, you can use it. shows you, for example, that Firefox is a web browser from Mozilla. You can enter the command anywhere, you don't have to be in the program's folder.

6. which - where is a program installed

The command shows you where a certain program is installed in Linux. outputs the path, for example / usr / bin / firefox.

7. man - display instructions for command

When you stumble upon an order and don't know what it's doing. Just enter, followed by the command. Then you will see instructions (Manual) how this works. You can use the arrow keys to scroll through the instructions in the terminal. With the key Q you finish the instructions.

In our example we have the instructions for the command clear requested:

8. cat - show file contents

The command shows you the content of a selected file in the terminal. shows you, for example, the content of the file cpuinfo from the directory / proc / at. It contains information about your processor.

For long text files you can use the addition instead less to use. This allows you to scroll through the output with the arrow keys. Presses Qto return to the terminal. Example:

9. df - display storage space usage

If you need a quick overview of how much space is still free on your partitions and hard drives, just enter. It works on its own, but the size information is more difficult to understand because it is given in 1K blocks.

You can see the current and most popular Linux distributions here:

10. lsblk - display partitions of hard drives

If you want a clear display of which partitions belong to which hard drive, then enter:

11. ps -e - show processes

If you want to terminate a certain (crashed) program via the terminal, you need its process ID (PID).

  • There is also a list of all running processes
  • A list of all processes of a specific user with
  • If you just want to know the PID of a certain program:
  • Here you can find out how to write the pipe symbol "|".

Example - Firefox crashed and frozen:

Then make a note of the PID and use it with the next command presented.

12. sudo killall -9 - terminate the crashed program

You also choke off properly stuck programs and processes. Then enter your password to confirm the command. If that doesn't help, only a forced restart will help. How you find out the PID of a program is written in the command above this.

In our picture we are looking for the PID from the VLC media player and compulsively terminate it:

13. whoami - who am I

The command simply outputs which user is currently logged into the terminal. By default, this is the user who is also logged into Linux, but you can also log into other user accounts via the terminal, in which case the user name would be displayed.

14. passwd - change password

If you want to change the password of the currently active user, see terminal command whoami, you can simply do that with. Then enter the current password, and then the new one twice.

15. shutdown - shut down the PC (time-controlled)

The terminal command can shut down your PC immediately or after a certain time:

  • shuts down the computer immediately.
  • automatically shuts down the computer in 30 minutes.
  • cancels the scheduled shutdown.

Which terminal commands do you still know that are essential for Linux beginners? Just write it to us in the comments.

You don't want to miss any news about technology, games and pop culture? No current tests and guides? Then follow us on Facebook (GIGA Tech, GIGA Games) or Twitter (GIGA Tech, GIGA Games).