My Linux Upskill Challenge - Day 1
Introduction
I’ve started following the Linux Upskill Challenge to sharpen my Linux knowledge and hands-on skills. It’s a series of 21 lessons designed to be completed daily, but I’ll be going through them at my own pace. I’ll share my journey and notes here as I move forward.
Day 1 - Get to know your server
- URL: https://linuxupskillchallenge.org/01/
- Previous Lesson: My Linux Upskill Challenge: Day 0
General Information
I connected to my Linux server in the cloud and ran the following commands:
lsb_release -a: Shows which Linux distribution and version is installed.cat /etc/os-release: Another way to check the distro—just look at the contents of this file.uname -a: Prints system information like kernel version and hardware platform.uptime: Displays how long the server has been running since the last restart or shutdown.cat /proc/uptime: Another way to check system uptime.whoami: Shows the current user.who: Lists all logged-in users.w: Shows what logged-in users are doing.
Hardware Information
lshw: Displays detailed hardware info.lscpu: Shows CPU information.lscpu | grep Hypervisor: Shows which hypervisor your VM is using—my EC2 instance uses Xen.lsblk: Lists storage devices and their partitions. This command led me to start reading about the 20250429T1746-snap-package-manager.lspci: Lists all PCI devices. These are emulated by the Xen hypervisor, and some are quite outdated.lsusb: Lists USB devices—my EC2 instance shows none, as expected.
Measuring Memory and CPU Usage
free -h: Displays memory usage in a human-readable format.vmstat: Gives a snapshot of system performance (CPU, memory, I/O, etc.). Usevmstat 1for continuous output.top: Real-time summary of system resource usage.htop: A more interactive, colorful version oftop.
Measuring Disk Usage
df -h: Shows disk space usage in human-readable format.du -h: Shows the size of directories and subdirectories (including hidden ones).sudo du -h --max-depth=1 /: Useful for checking the largest folders under/.
Measuring Network Usage
ifconfig: Lists network interfaces and IPs (deprecated, but pre-installed). My EC2 instance shows two:enX0andlo(loopback).ip address: The modern replacement forifconfig.netstat -i: Displays interface statistics. It’s deprecated in Ubuntu 24.04.2 LTS and not available by default. I installed it using:sudo apt install net-tools -yifstat: Live bandwidth usage per interface. Not installed by default—installed with:sudo apt install ifstatnload: A real-time visual network monitor.sudo iftop -i enX0: Shows live connections, traffic direction, and throughput (liketop, but for the network).
Extra: Modern Replacements for netstat
Old netstat Command | Modern Alternative | Purpose |
|---|---|---|
netstat -i | ip -s link | Interface stats |
netstat -tuln | ss -tuln | Listening ports (TCP/UDP) |
netstat -rn | ip route show | Routing table |
netstat -a | ss -a | All sockets |
netstat -plnt | ss -plnt | Listening TCP ports + PID |
Additional Readings
- What is swap and swap space?
- How Linux handles out-of-memory situations
- How to check CPU usage in Linux
- How to check disk usage and I/O in Linux
- 20 Best Linux Bandwidth Monitoring Tools
Related Notes
Nota diaria: 2025-04-29