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

 

More in This Category
Linux info Command: Browse GNU Documentation

Linux info Command: Browse GNU Documentation

Learn how to use the Linux info command to browse hierarchical GNU manuals and navigate Info nodes, with essential options, practical examples, output interpretation, and common troubleshooting tips.

Linux unzip Command: List and Extract ZIP Archives

Linux unzip Command: List and Extract ZIP Archives

Learn how to list and Extract ZIP Archives with the Linux unzip command, including practical examples, key options, and important precautions.

Linux Tutorial / Inspect, Pause, and Stop Processes

Linux Tutorial / Inspect, Pause, and Stop Processes

Inspect Linux processes with ps, top, and pgrep, then safely pause, resume, and terminate a practice process while distinguishing shell jobs from services.

Linux wc Command: Count Lines, Words, Characters, and Bytes

Linux wc Command: Count Lines, Words, Characters, and Bytes

Learn how to use the Linux wc command to count lines, words, characters, and bytes in files or standard input, with essential options, practical examples, output interpretation, and common troubleshooting tips.

Linux xargs Command: Pass Standard Input as Command Arguments

Linux xargs Command: Pass Standard Input as Command Arguments

Learn how to pass Standard Input as Command Arguments with the Linux xargs command, including practical examples, key options, and important precautions.

Linux sed Command: Search and Replace Text Streams

Linux sed Command: Search and Replace Text Streams

Learn how to search and Replace Text Streams with the Linux sed command, including practical examples, key options, and important precautions.

Linux chgrp Command: Change a File's Group

Linux chgrp Command: Change a File's Group

Learn how to change a File's Group with the Linux chgrp command, including practical examples, key options, and important precautions.

Linux cmp Command: Compare Files Byte by Byte

Linux cmp Command: Compare Files Byte by Byte

Learn how Linux cmp compares two files byte by byte, reports the first mismatch, runs silently in scripts, limits ranges, and differs from diff and checksums.

Linux less Command: Browse and Search Long Text Files

Linux less Command: Browse and Search Long Text Files

Learn how to browse long files with Linux less, move forward and backward, search text, follow growing logs, preserve colors, and exit the pager.

Linux uptime Command: Check Uptime and Load Averages

Linux uptime Command: Check Uptime and Load Averages

Learn how to use the Linux uptime command to check how long the system has been running and interpret load averages, with essential options, practical examples, output interpretation, and common troubleshooting tips.