Skip to main content

linux

GNU/Linux

History

  • Started in 1983 by Richard Stallman, the GNU Project aimed to build a free Unix-like OS
  • By the early 1990s, GNU lacked a kernel until Linus Torvalds created the Linux kernel in 1991, released under the GNU GPL in 1992
  • Together, they formed GNU/Linux, a free, open-source alternative to proprietary Unix
  • GNU/Linux is packaged into user-friendly distributions like Ubuntu, Debian, and Fedora, each offering unique features and interfaces

Key features

  • Free and open-source, unlike paid Unix systems
  • GNU tools paired with the Linux kernel
  • Kernel manages CPU, memory, and storage
  • Distributions (e.g., Ubuntu for beginners, Debian for stability, Fedora for cutting-edge updates) make GNU/Linux accessible

Learn more

Linux Directory Structure

img

Shell, Console, and Terminal

Console

  • Physical devices to interact with the computer such as screen, keyboard, and mouse

Terminal

  • A program acts as a wrapper to enter commands

Shell

  • A command line interpreter that receives and executes commands

Basic Commands

Fun fact

  • A directory is a just a file containing the names of other files
  • Sudo: Superuser do
CategoryPopular Commands
File & Directory Managementls, cd, pwd, cp, mv, rm, mkdir, touch, ln -s
Viewing & Editing Filescat, less, head, tail, nano, vim
Searching Files & Textfind, grep, locate, wc
User & Group Managementsudo, su, useradd, usermod, userdel, groupadd, passwd, id, who, whoami, last, w
Permissions & Securitychmod, chown, chgrp, visudo, getfacl, setfacl, openssl, fail2ban
Process & Performanceps, top, htop, kill, killall, vmstat, iostat, free, lsof, ulimit -a
Disk & Filesystemdf -h, du -sh, lsblk, mount, umount, fdisk -l, mkfs
System & Hardware Infouname, uptime, hostname, lscpu, lsblk, lspci, lsusb, lshw, dmidecode
Networkingping, ip/ifconfig, ssh, scp, wget, curl, ss, netstat, traceroute, nmap, dig, host
System Services (systemd)systemctl (start, stop, enable, status), journalctl, shutdown, reboot
Firewall Managementiptables, firewalld (firewall-cmd), ufw
Archiving & Backuptar, gzip, gunzip, zip, unzip, rsync, dd, dump, restore
Package Managementapt/dnf/yum/pacman (install, remove, update, search)
Remote Administrationssh, scp, tmux, screen, watch
System Loggingjournalctl, dmesg, tail -f /var/log/syslog, logrotate
Job Schedulingcrontab -e, crontab -l, at
Shell & Environmentecho, export, alias, source, env, history, man, --help, clear
Development & Misc. Toolsgit, make, gcc/g++, tee, sleep, which, type, xargs
Web & Database Servicesapachectl, nginx -s, mysql, psql
Containerizationdocker/podman (ps, images, run, stop), virsh, kvm

Practice

telnet google 80
man telnet
telnet --help
which telnet

ls /usr/bin | grep telnet

docker ps -a | awk 'NR>2 {print $2}'

find . -type f -size +1G
find . -type d -size +1G

du -sh *
df -h

top

su kyphan -s /bin/bash
chmod o-rx tmp
chmod -R o-rx tmp

cd /etc
cat passwd
cat group
cat hosts
cat sudoers