[Notes] Linux7 basic knowledge commonly used commands and services

cd
ls
ll
pwd
echo
cat
touch
head
tail
yum
systemctl
ifconfig
netstat -lnpt
temporarily turn off SELinux setenforce 0
see status getenforce

UID is the user identification, user number. Starting from 0, root is 0, and Linux7 ordinary accounts start from 1000.
GID is the group ID.
Account information file /etc/passwd
account password information /etc/shadow default access permission 400, the format of each line is:
username:password:last:may:must:warn:expire:disable:reserved
group account /etc/group
group password /etc/gshadow

New user
useradd -u specifies the UID
useradd -d specifies the home directory
useradd -g specifies the group ID
useradd -p password (no space after p)

su switch account
exit exit account
sudo

date
date +%Y%m%d%H%M%S
Insert picture description here

users
vim
vi
fdisk -l Hard disk partition
df partition uses
du file to occupy
mount Mounting situation
To mount a USB flash drive, you can use fdisk -l to view the partition situation when the USB flash drive is not mounted, and view the name of the USB flash drive.
Mount the CD image, such as:
mount -t iso9660 /dev/... CD device file /mnt/. . . The location to be mounted
Mount the USB flash drive, for example:
mount -t vfat /dev/sdb1 /mnt/usb1
Unmount the device:
umount /mnt/usb1
first check the location of the mount.

File type
-ordinary file
d directory file
l link file
other special files (b block file, c character device, p command pipeline, s socket socket)

file + file name

chmod
chown
421
read and write execution
u user user g group same group o other others a all everyone

File operation
cp
mv
mkdir
rm
rm -f
rm -rf (use with caution)

Linux does not have a file recycle bin.

Pack and compress
tar
tar -czvf
tar -xzvf

ip route add
ip neighbour
wget

yum install
yum install -y
yum remove
yum info
yum list

DHCP服务
yum install -y dhcp
DNS named.service
yum install -y bind
主配置文件/etc/named.conf
nslookup
name-chroot
WEB
yum install -y httpd
httpd.service
/etc/httpd/conf/ httpd.conf

Virtual port:
#ifconfig ens33:1 10.1.1.2 up

View CPU load status
uptime
w

Guess you like

Origin blog.csdn.net/qq_43750882/article/details/111464125