Linux
Linux is an open-source operating system based on Unix, created by Linus Torvalds in 1991.

Before Starting
Linux is an open-source operating system based on Unix, created by Linus Torvalds in 1991. It consists of a kernel and multiple distributions (like Ubuntu, Fedora or Debian). It is used in servers, supercomputers, Android and even IoT devices. Its main advantage is the stability, security and customization it offers compared to other systems.
In other operating systems (like Windows or macOS) many things are limited or automated, while in Linux you have full control.
-
If something fails, you can fix it yourself without depending on updates or licenses.
-
If you work with servers, networks or development, almost everything works better and more stable on Linux.
-
If you program or manage systems, understanding Linux prepares you for any professional environment, since most of the world's servers use it.
Before using commands, there are several basic things that make Linux make sense:
-
Everything in Linux is a file, even devices (
/dev/sda), configurations (/etc) and virtual processes (/proc). -
The file system is hierarchical, starting from
/(the root) and from there it goes down:/home,/etc,/usr,/var, etc. -
Permissions work with numbers:
-
r = 4, w = 2, x = 1.
Example:
7 = 4+2+1→ read (4), write (2) and execute (1). That's why754means:-
7 → owner: rwx
-
5 → group: r-x
-
4 → others: r--
-
-
-
sudo means "do it as administrator". It's used to execute actions that affect the system (install, delete, modify configurations).
-
apt is the package manager for Debian/Ubuntu, it allows you to install, update or remove programs.
-
nano is a simple text editor, useful for editing configurations without relying on a graphical environment.
-
The terminal is an interface to control the system with commands and many of them are designed to be chained together using pipes (
|), redirections (>,>>). -
Users and groups determine who can do what, and that's why
chmod,chown, etc. are important.
Getting Started
Small practical reference to move and work in the terminal without getting tangled. Ideal if you access via SSH or are starting in Linux.
Basic navigation
To move through the file system you need to locate yourself, list and change directories.
| Command | Description |
|---|---|
pwd | Shows the current path (which folder you are in) |
ls | Lists the files and folders of the current directory |
ls -l | Lists with details (permissions, size, date, etc.) |
ls -a | Also shows hidden files |
cd folder | Changes folder |
cd .. | Goes up one level |
cd ~ | Goes to the user's directory (home) |
clear | Clears the screen |
Handling files and folders
Editing, creating, moving and deleting files is basic for any terminal administration.
| Command | Description |
|---|---|
touch file.txt | Creates an empty file |
mkdir new_folder | Creates a folder |
cp source destination | Copies files or folders |
mv source destination | Moves or renames files |
rm file.txt | Deletes a file |
rm -r folder | Deletes a folder and its content |
cat file.txt | Shows the file content |
nano file.txt | Edits a file in terminal (simple editor) |
head file.txt | Shows the first lines |
tail file.txt | Shows the last lines |
Useful tip:
tail -f file.log shows the content of a log live.
Permissions and owners
Linux controls access through users, groups and permissions. Remember: r=4, w=2, x=1.
| Command | Description |
|---|---|
chmod 755 file | Changes permissions (read, write, execute) |
chmod +x script.sh | Gives execution permission to the file. |
chown user:group file | Changes the owner |
ls -l | Allows seeing the current permissions |
Structure of a permission:
drwxr-xr-- → type + owner + group + others.
System information
It allows you to see how the system is, the resources and what is running.
| Command | Description |
|---|---|
whoami | Shows your username |
hostname | Shows the machine name |
uname -a | Shows system information |
top | Shows active processes and CPU/RAM usage |
df -h | Shows available disk space |
free -h | Shows used and free RAM |
Also useful:
htop(if you install it), to see processes more nicely.
Packages and updates (Ubuntu/Debian)
apt manages system packages (programs, libraries, tools).
| Command | Description |
|---|---|
sudo apt update | Updates the list of available packages |
sudo apt upgrade | Installs available updates |
sudo apt install package | Installs a package |
sudo apt remove package | Uninstalls a package |
apt search name | Searches for a package |
Other useful commands
| Command | Description |
|---|---|
history | Shows the last used commands |
echo "text" | Shows text on screen |
man command | Opens the command manual |
exit | Closes the current session |
shutdown now | Turns off the system |
reboot | Restarts the system |
Tips
-
Use the Tab key to autocomplete commands or paths.
-
Use the ↑ and ↓ arrows to repeat previous commands.
-
Always be careful with
sudoand withrm -r. -
If a command doesn't work, try preceding it with
sudo. -
man commandalways explains better than the internet. -
Think before using
sudoDon't execute things "just because". If you don't know what a command does, checkmanor search first. -
Avoid using
rm -rin incomplete paths One misplaced space and you could delete half the system. Tip: before executing, usels folder_you_are_going_to_deleteto confirm. -
Don't work as root unless necessary A small error as root can break the entire system.
-
Use absolute paths when doing delicate tasks Avoid depending on "where you are standing".
-
Document changes you make to
/etcEven if it's just with a comment at the beginning of the file or a.backupfile. -
Don't install packages recklessly Keep the system clean. Unnecessary packages = more things that can break.
-
Update, but not compulsively
apt update && apt upgradeis fine… but don't do it 100 times a day or on critical systems without checking what gets updated. -
Use
grep,tail,journalctland logs to diagnose Guessing wastes time. Logs almost always have the answer. -
Make simple, modular and commented scripts You'll thank yourself later.
-
Use minimum necessary permissions Don't give everything
777"to make it work". Many times the problem is not about permissions, but about paths or users. -
Learn to use
taband history It speeds up your work and prevents you from making mistakes typing long paths. -
Keep your structure organized Folders with clear names, files in consistent places, and no trash left around.
-
Make backups before editing important files Example:
cp /etc/file.conf /etc/file.conf.bak -
Don't accept commands from someone without reading them Especially if they include pipes with
sh,curl,wget, or strange things. -
Using
sudowithout understanding what the command does It's the fastest way to break your system.sudo rm -r /is a classic joke… but it happens more often than you think. -
Working as root all the time If you're root, any error is fatal: you can delete, overwrite or break services without the system warning you.
-
Giving permissions
777"to make it work" This leaves the file or folder completely exposed. If something requires777, the problem is elsewhere. -
Editing configuration files without backup If you mess up, you won't have a way to go back.
-
Ignoring logs Many novices try to guess why something is failing. Logs almost always tell you exactly what happened.
-
Copying commands from the internet without reading them Worse if they come with pipes to sh, downloaded scripts or strange paths.
-
Using relative paths for dangerous operations If you're in the wrong folder… goodbye files.
-
Filling the system with unnecessary packages More packages → more updates → more dependencies → more problems.
-
Forgetting to close processes or SSH sessions Creates conflicts, zombie processes, and sometimes even lockups.
-
Installing random versions from the internet Especially suspicious .sh files or packages that aren't from the official repository.
-
Working without checking what services are running Modifying configurations while a service is running can cause errors that are later difficult to trace.
-
Not knowing the actual user that runs something Many services run under users like
www-data,postgres, etc. And if you change permissions without understanding that, you break apps by mistake. -
Deleting folders or files generated by the system "because you don't understand them" Especially in
/var,/usr,/etcand/lib.
Extras
Extra links and official documentation for linux and many related services.
Kernel and system
-
Linux Kernel Archive - https://www.kernel.org
-
Freedesktop (standards for desktop and system) - https://www.freedesktop.org
Distributions
-
Ubuntu - https://ubuntu.com
-
Debian - https://www.debian.org
-
Fedora - https://getfedora.org
-
Arch Linux - https://archlinux.org
Package managers
-
APT (Debian/Ubuntu) - https://wiki.debian.org/Apt
-
DPKG - https://wiki.debian.org/dpkg
-
Pacman (Arch) - https://wiki.archlinux.org/title/Pacman
-
DNF (Fedora) - https://dnf.readthedocs.io
Manuals and general documentation
-
GNU Coreutils - https://www.gnu.org/software/coreutils/manual
-
Bash Reference Manual - https://www.gnu.org/software/bash/manual
-
Man7 (advanced manuals) - https://man7.org
-
Arch Wiki (the Linux bible, useful for everything) - https://wiki.archlinux.org
Administration and servers
-
OpenSSH - https://www.openssh.com
-
Systemd - https://systemd.io
-
Nginx - https://nginx.org/en/docs
-
Apache - https://httpd.apache.org/docs
-
GNU Coreutils. (n.d.). GNU Coreutils Manual. Free Software Foundation. https://www.gnu.org/software/coreutils/manual
-
GNU Bash. (n.d.). Bash Reference Manual. Free Software Foundation. https://www.gnu.org/software/bash/manual
-
Linux man-pages project. (n.d.). Linux manual pages (man). https://man7.org
-
Debian Project. (n.d.). APT - Debian Wiki. https://wiki.debian.org/Apt
-
GNU chmod. (n.d.). chmod invocation - GNU Coreutils Manual. https://www.gnu.org/software/coreutils/manual/html_node/chmod-invocation.html
-
Linux Foundation. (n.d.). Filesystem Hierarchy Standard (FHS). https://refspecs.linuxfoundation.org/fhs.shtml
-
Arch Linux. (n.d.). ArchWiki. https://wiki.archlinux.org
Authors

GIIA