Linux Administration Memo: Essential Commands and System Checks
How to check if a port on another computer is open
You can check with the nc command.
# nc -zv google.com 443 Ncat: Version 7.92 ( https://nmap.org/ncat ) Ncat: Connected to 142.250.207.110:443. Ncat: 0 bytes sent, 0 bytes received in 0.07 seconds.
If you want to check if a UDP port is open, add the -u option.
# nc -zv -u 8.8.8.8 53 Ncat: Version 7.92 ( https://nmap.org/ncat ) Ncat: Connected to 8.8.8.8:53. Ncat: UDP packet sent successfully Ncat: 1 bytes sent, 0 bytes received in 2.00 seconds.
How to check CPU information
# lscpu
# cat /proc/cpuinfo
The difference between # and $ in the terminal
# means running with root (administrator) privileges.
[root@localhost ~]#
$ means running with regular user privileges.
[jb@localhost ~]$
How to check memory type
# dmidecode --type memory # lshw -short -C memory
How to mount CD and ISO
CD Mount
Create a directory to mount
# mkdir /aaa
Mount
# mount /dev/cdrom /aaa mount: /aaa: WARNING: source write-protected, mounted read-only.
Unmount
# umount /aaa
ISO Mount
Create a directory to mount
# mkdir /aaa
Mount
# mount /root/Disc.iso /aaa -o loop mount: /aaa: WARNING: source write-protected, mounted read-only.
Unmount
# umount /aaa
How to check the file system
# df -T
# lsblk -f









