Linux / Port Checks, System Information, and ISO Mounting Notes

Choose Linux inspection commands according to whether you need port, CPU, memory, or filesystem information. A successful UDP send does not prove that a service responded or that its port is open; verify the actual ISO and mount point before mounting an image read-only.

Distinguish TCP reachability from UDP responses

Check command -v nc dig before starting. If a command is missing, obtain Netcat or Ncat and DNS lookup tools from the distribution repositories. For example, inspect netcat-openbsd/dnsutils on Ubuntu or nmap-ncat/bind-utils on Rocky for actual package availability. There is no need to install an arbitrary external binary.

nc -zv -w 3 example.com 443

A successful TCP connection shows reachability at that moment, not a valid HTTPS certificate or a healthy application. nc may be OpenBSD netcat, Nmap Ncat, or another implementation; inspect nc -h for supported options.

nc -zv -u -w 3 8.8.8.8 53
dig @8.8.8.8 example.com A +time=2 +tries=1

UDP has no TCP-style handshake. A successful send or lack of response from nc cannot distinguish an open port from filtering. Use a valid protocol request, such as a DNS query, and inspect its response and source. A dig timeout alone does not prove a server outage: routing, firewalls, and response policies also matter.

Nmap’s UDP response interpretation explains why silence does not establish that a port is open.

Inspect CPU and physical memory information

lscpu
cat /proc/cpuinfo
sudo dmidecode --type memory
sudo lshw -short -C memory

lscpu reports CPU structure; dmidecode reports memory-device information supplied by firmware. Check the distribution’s dmidecode and lshw packages if these tools are missing. VMs and containers may hide physical DIMM details or show virtual values. Installed memory type and current RAM usage are different questions; use tools such as free for usage.

Understand # and $ in shell prompts

By convention, # marks a root shell and $ a normal user shell, but prompts are customizable and do not prove privileges. Check id -u and the actual sudo policy. Copyable commands here omit prompts and use sudo explicitly for privileged operations.

id -u
whoami

Mount an optical disc or ISO read-only

Inspect devices and existing mounts first. Replace /dev/sr0 and /path/to/image.iso with your real device and trusted image. Ensure the empty /mnt/iso-lab mount point will not hide existing data.

lsblk -f
findmnt --mountpoint /mnt/iso-lab
sudo mkdir -p /mnt/iso-lab

Choose either the optical-disc or the ISO command, not both. Do not stack mounts on an occupied mount point.

sudo mount -o ro /dev/sr0 /mnt/iso-lab
sudo mount -o loop,ro /path/to/image.iso /mnt/iso-lab
findmnt --mountpoint /mnt/iso-lab
ls -la /mnt/iso-lab
sudo umount /mnt/iso-lab

The ISO command uses a loop device for an ordinary file. Distinguish expected write-protection notices from errors. If umount reports that the target is busy, stop using that path and close open files before retrying; forced unmounting is not the default fix.

Inspect filesystem types

df -T
lsblk -f

df reports mounted filesystems and their usage; lsblk shows block devices and filesystem metadata such as UUIDs. They cover different objects, including unmounted partitions and network mounts, so their lists need not match.