Update everything (Ubuntu/Debian)
Refreshes package lists and installs all available updates.
sudo apt update && sudo apt upgrade -yEveryday Linux commands for Ubuntu, Debian, Fedora and Arch: updating packages, managing systemd services, checking resources, processes, permissions and the firewall.
25 commands
Refreshes package lists and installs all available updates.
sudo apt update && sudo apt upgrade -yRefreshes metadata and upgrades all packages.
sudo dnf upgrade --refreshSyncs the package database and upgrades the system.
sudo pacman -SyuDeletes packages nothing depends on and clears the download cache.
sudo apt autoremove -y && sudo apt cleanDisk usage of every mounted drive in human-readable sizes.
df -hSize of each item in the current folder, smallest to largest.
du -sh * | sort -hUsed, free and available RAM and swap.
free -hThe ten processes using the most memory.
ps aux --sort=-%mem | head -n 10Asks the process to exit. If it ignores you, use kill -9 to force it.
kill Stops every process whose command line matches.
pkill -f Matches broadly; check with pgrep -fl first.
Shows whether a service is running and its latest log lines.
systemctl status Stops and starts the service.
sudo systemctl restart Enables the service at boot and starts it immediately.
sudo systemctl enable --now Streams new log lines as they arrive. Ctrl+C to stop.
journalctl -u -fName, version and ID of the Linux distribution.
cat /etc/os-releaseKernel name, version and architecture.
uname -aLets you run it with ./script.sh.
chmod +x Fixes "permission denied" on files created by root.
sudo chown -R $USER:$USER Adds the user to the sudo group (wheel on Fedora/Arch). They need to log in again.
sudo usermod -aG sudo Every open TCP/UDP port with the process that owns it.
sudo ss -tulpnAllows incoming traffic on a port (Ubuntu’s ufw). Enable the firewall with sudo ufw enable.
sudo ufw allow /tcpAlways allow SSH (22) before enabling ufw on a remote server, or you’ll lock yourself out.
Opens your cron table. Each line is: minute hour day month weekday command.
crontab -eRefreshes the output on screen. Ctrl+C to stop.
watch -n For Wayland desktops. On X11 use: xclip -selection clipboard < file.
wl-copy < Model, cores, threads and cache sizes.
lscpuEvery command copies as plain, clean text: no curly quotes, no long dashes, no invisible characters.