Linux commonly used commands

Linux commonly used commands

Linux commonly used commands

System articles

CPU

bash
lscpu
cat /proc/cpuinfo

RAM

bash
# View the number and usage of motherboard memory slots
dmidecode|grep -P -A 5 "Memory\s+Device" | grep Size|grep -v Range

# View the maximum memory supported by the motherboard
sudo dmidecode | grep -P'Maximum\s+Capacity'

# View memory frequency
sudo dmidecode | grep -A16 "Memory Device" | grep'Speed '

# View memory and swap space usage
# -h View in Gibibytes.
free -m

hardware equipment

bash
# View hardware device
lshw
# PCI device list
lspci
# List block device
lsblk
# List partition table
fdisk -l

Transmission

scp

bash
# Use scp to transfer the file to transfer the local file data.zip to the server /data directory-
# P ssh port number
scp -P 22 /data/data.zip root@spaceack.com :/data

# Use scp to transfer files to transfer the remote directory remote_path to the local current directory
scp remote_username@remote _ip:/remote_path/*.

Use rsync to resumable uploads to backup resource directories containing large amounts of data!

bash
rsync -vrtP --rsh='ssh -p 10050' root@66.6.66.666:/data/* /data/backup

-v, --verbose Verbose mode output.

-r, --recursive Subdirectories are processed recursively.

-t, --times keep file time information.

-P, --partial breakpoint to resume the transfer, --progress shows the transfer process.

--Rsh=COMMAND specifies the use of rsh and ssh for data synchronization, and rsh is clear text transmission.

-u, update only, prevent new local files from being overwritten (do not overwrite updated files).

--Ignore-existing, skip existing files on the receiving end, which will be used for directory incremental backup.

other

bash
# View the number of host ssh connections
w | grep pts |wc -l

# File batch rename
apt install rename

# Make U Disk Boot Disk (Centos7)
pv -cN source <CentOS-7-x86_64-DVD-1804.iso | sudo dd of=/dev/sdc

Select time zone tzselect

bash
tzselect
# View time
date

What's Your Reaction?

like
0
dislike
0
love
0
funny
0
angry
0
sad
0
wow
0