########时间同步#########
##服务器端
vim /etc/chrony.conf
3 #server 0.rhel.pool.ntp.org iburst
4 #server 1.rhel.pool.ntp.org iburst
5 #server 2.rhel.pool.ntp.org iburst
6 #server 3.rhel.pool.ntp.org iburst
23 allow 172.25.254.0/24 #允许172.25.254.0网段的主机同步时间
30 local stratum 10 #同步时间的频率
##客户端
vim /etc/chrony.conf
3 #server 0.rhel.pool.ntp.org iburst
4 #server 1.rhel.pool.ntp.org iburst
5 #server 2.rhel.pool.ntp.org iburst
6 #server 3.rhel.pool.ntp.org iburst
改为
3 server 172.25.254.32(服务器的ip) iburst
其他的地方不动
服务器要关闭防火墙
双方都要重启以下chrony服务
systemctl restart chronyd.service
####设备访问#####
1.设备识别
/dev/xdxn ##硬盘设备/dev/sda1
/dev/cdrom ##光驱
/dev/mapper/* ##虚拟设备
2.设备的使用
fdisk -l ##查看真实存在的设备
cat /proc/partitions ##系统能够识别的设备
blkid ##系统能够挂载使用的设备id
df ##查看设备被系统使用的情况
##设备的使用###
1.设备的挂载
mount 设备 挂载点
mount /dev/sdb1 /mnt #把系统中第二块硬盘的第一个分区挂载到/mnt目录
2.卸载设备
umount 设备|挂载点
如出现以下情况:
[root@foundation0 ~]# umount /dev/sdb1
umount: /home/kiosk/Desktop/photo: target is busy.
(In some cases useful info aboutprocesses that use
the device is found by lsof(8) orfuser(1))
解决:
fuser -kvm 设备|挂载点 -k kill,-v显示详细信息,-m扫描设备
###2.软硬链接######
ls -i ##查看文件节点号
ln -s /file /file1 ##软链接
ln /file /file1 ##硬链接
####3.文件查找####
1.locate filename ##在文件数据库中搜索filename信息,updatedb更新文件数据库
2.find
find 查找位置 -条件 条件值 -exec动作{}\;
-name ##按照名字查找
-user ##按照所有者查找
-group ##按照所在组查找
-size ##按照文件大小查找
-perm
-a ##与
-o ##非
#########5.timedatectl命令##########
timedatectl status ##显示当前时间信息
set-time ##设定当前时间
set-timezone ##设定当前时区
set-local-rtc 0|1 ##设定是否使用utc时间
chrony时间同步、新硬盘的识别和使用、软连接和timedatectl
最新推荐文章于 2023-10-18 10:56:11 发布