Linux Terminal Tips!@!1!

i'm... i'mmmm scaaaareeed of lii.. lii. li. nux because i don't know how to use the terminal!

Okay... Most people, like your dad or random office worker, don't even think of switching to Linux, because everyone tells them they're going to use terminal a lot and they know nothing about it. That's not always true, but people who use the terminal are naturally going to say that you'll use it.

But if you want to use it and learn it, this tutorial is for you.


a few disclaimers 4 you:

so... let's get started

First you need to understand some key concepts.

Terminal is that window which allows you to interact w/ the shell and see the output of commands. Shell is the thing that allows you to write commands and handles the execution of them.

Then launch the terminal. You shall have it preinstalled, look for something called:

Usually the first result you get will be the terminal. If not, then go here and try to find it. Launch it like you normally launch your GUI (graphical) programs.

Process Management

imagine this: something crashed, mostly on the terminal, Ctrl+C/Alt+F4 doesn't work, and it's not a graphical application, which means you won't get this nice popup "The application is not responding". or you just want to quit something but it only moved to the background.

nope, you don't need to go to the system monitor.

ps aux | grep "YOUR_PROCESS_NAME_HERE"

this will show you the list of all running processes with name/argument "YOUR_PROCESS_NAME_HERE". Let me quickly explain it to you:

You'll get an output like this:

your_username 4357 200 0.1 12388 pts/4 R+ 12:01 0:00 "YOUR_PROCESS_NAME_HERE"

After your username get that first number. It's the process ID. You need to pass it to another command like this.

kill -9 4357

That will instantly kill the process. Of course you can pass at the end multiple process IDs. Remember to split them by space.

I'm not a fan of pkill because it doesn't work for me very well and it isn't that accurate as the above command.

File Management

Pssst... I recommend you running alias "md=mkdir", it often makes your life easier.

And also remember: if a file has spaces in name, wrap it between quotes.

Here are some commands you'll need for the file management:

By the way, you can use ./ to use current directory, ../ to use the parent directory or / at the beggining to use the root directory.

Escalating your permissions

You can use sudo to escalate your permissions to the root account, something like admin rights on Windows. Remember that it can modify nearly every single file in your system, so be careful. You just prefix your command with sudo to get started. It'll ask for your password.

Package management

Click your distro for a tutorial (it'll only add the contents on the page, not redirect you somewhere): Debian/Ubuntu/Mint/Debian-based, Fedora-based coming soon, Arch/CachyOS/Arch-based

Before installing anything, do sudo apt update. That won't update the packages on your system, only the dependency list to safely install a package. Then do:

sudo apt install YOUR_PACKAGE_HERE

If you want to upgrade all packages in your system do:

sudo apt update && sudo apt upgrade

If you want to delete a package:

sudo apt remove YOUR_PACKAGE_HERE

It deletes the package, but not configuration files. If you want to do that too, try:

sudo apt purge YOUR_PACKAGE_HERE

It deletes the program and the config files.

To install a package:

sudo pacman -S YOUR_PACKAGE_HERE

If you want to upgrade all packages in your system do:

sudo pacman -Syu

If you want to delete a package:

sudo pacman -R YOUR_PACKAGE_HERE

If the installation or the update generates errors, try:

sudo pacman -Syy[u if update] [package name if installation]

Choose that distro to continue.


That's everything for now.