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 comm Command: Compare Two Sorted Files

Linux comm Command: Compare Two Sorted Files

Learn how to compare Two Sorted Files with the Linux comm command, including practical examples, key options, and important precautions.

Linux Tutorial / Find Files and Commands with find, locate, which, and whereis

Linux Tutorial / Find Files and Commands with find, locate, which, and whereis

Compare find and locate for file searches, then use which, whereis, and Bash type to distinguish executable paths from shell command resolution.

Linux help Command: Read Help for Bash Built-in Commands

Linux help Command: Read Help for Bash Built-in Commands

Learn how to use the Linux help command to read usage information for Bash built-in commands, with essential options, practical examples, output interpretation, and common troubleshooting tips.

Linux ps Command: Inspect Running Processes

Linux ps Command: Inspect Running Processes

Learn how to inspect Running Processes with the Linux ps 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 ssh Command: Connect to a Remote Host Securely

Linux ssh Command: Connect to a Remote Host Securely

Learn how to connect to a Remote Host Securely with the Linux ssh command, including practical examples, key options, and important precautions.

Essential Linux Commands: A Practical Reference by Task

Essential Linux Commands: A Practical Reference by Task

Browse essential Linux commands by task, including help, files, text processing, permissions, processes, networking, packages, storage, and system administration.

Linux umask Command: Control Default File Permissions

Linux umask Command: Control Default File Permissions

Learn how to control Default File Permissions with the Linux umask command, including practical examples, key options, and important precautions.

Linux free Command: Check Memory and Swap Usage

Linux free Command: Check Memory and Swap Usage

Learn how to use the Linux free command to inspect available memory, used memory, cache, and swap usage, with essential options, practical examples, output interpretation, and common troubleshooting tips.

Linux gzip Command: Compress a File in gzip Format

Linux gzip Command: Compress a File in gzip Format

Learn how to compress a File in gzip Format with the Linux gzip command, including practical examples, key options, and important precautions.