Terminal

From Linux Gaming
Jump to navigation Jump to search

The terminal is the black thing with text you probably have already seen in some hacker movies. It might look scary, but it basically works like a voice assistant with text input.

If you see instructions in the form of sudo pacman -Q | grep -i -C 10 "apt", then this is something you have to put into the terminal.

How to use the terminal

Where do I find the terminal?

You will probably find it somewhere in your menu. It might have a name like Gnome-Terminal, Konsole, Xterm, Terminator, or something else. It will probably have an icon that looks vaguely like a terminal (black background, white text).

How does the terminal work?

You write a line of text, you press enter, and you look at what happens. The terminal usually tells you if something goes wrong. Sometimes you need to press additional buttons like y for "yes" or n for "no".

Should I read the output?

Yes, it might contain warnings. However: Sometimes the output is very long, for example if you install software. In this case, you don't have to read everything. The important stuff will be at the end.

Should I take warnings seriously?

YES! It's not your average "You could harm your computer" bullshit you are used to from Windows.

Is the terminal dangerous?

It might look scary, but it's not dangerous. If you write something wrong, it will just tell you that it's wrong - your computer will not explode. But be wary, the terminal is a way to operate your computer. In the same way you might harm your computer with the GUI, you might as well harm it with the terminal. (That's why you should read the output.) More on this topic in the next section.

Dangers of the terminal

So should I just input whatever I find at some random place in the internet?

NO! You should not copy/paste stuff from untrusted sources (like this wiki - everyone can edit it) if you don't understand what you're doing. The commands might be malicious. For example, if you would type the following, you would delete everything on your computer, and potentially destroy your motherboard:

DO NOT DO THIS!

sudo rm -rf / --no-preserve-root

Other commands may uninstall your graphical user interface, or install a remote access for hackers.

This sounds scary!

Don't be afraid. Malicious tutorials for Linux are rarer than malware for Windows (I don't even know if this ever happened somewhere), and if someone did, it would probably get noticed very fast.

If you're fine with installing software on Windows, you should be fine with tutorials for Linux. But still. Be wary.

Could I harm my computer if I type malicious commands by accident?

Probably not. It's not easy to input these commands by accident. You might type sudo rm -rf / by accident, but you won't type the --no-preserve-root if you don't actually want to harm your computer. You should be careful when running sudo though. This is the equivalent to "Administrator access", but much more powerful. You should always avoid running a root-shell (a shell where you have sudo access without typing sudo). You would detect it by the # symbol at the beginning of each line.

What else can go wrong?

There might be instances where you copy a command from some website, and you also copy the "enter command". This might lead to enter being automatically pressed at the end of the line, and the command being executed without additional interaction by you. If you want to modify the command before executing it, this would be unintended behavior. To prevent it, you can copy to a text editor first, modify the commands, and then copy to the terminal.