[时间同步]
1.服务端
yum install chrony -y **安装服务
vim /etc/chrony.conf **配置文件
# Allow NTP client access from local network.
allow 172.25.254.0/24 **允许谁去同步我的时间
# Serve time even if not synchronized to any NTP server.
local stratum 10 **不同步任何人的时间,时间同步服务器级别
systemctl restart chronyd
systemctl stop firewalld
2.客户端
#server 0.rhel.pool.ntp.org iburst
#server 1.rhel.pool.ntp.org iburst
#server 2.rhel.pool.ntp.org iburst=====>server ntpserverip iburst
#server 3.rhel.pool.ntp.org iburst
systemctl restart chronyd
测试
[root@localhost ~]# systemctl restart chronyd
[root@localhost ~]# chronyc sources -v
210 Number of sources = 1
.-- Source mode '^' = server, '=' = peer, '#' = local clock.
/ .- Source state '*' = current synced, '+' = combined , '-' = not combined,
| / '?' = unreachable, 'x' = time may be in error, '~' = time too variable.
|| .- xxxx [ yyyy ] +/- zzzz
|| / xxxx = adjusted offset,
|| Log2(Polling interval) -. | yyyy = measured offset,
|| \ | zzzz = estimated error.
|| | |
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* 172.25.254.49 10 6 17 2 -40ms[ -40ms] +/- 43ms
两边都清空日志 >/var/log/messages
[5.timedatectl命令]
timedatectl status **显示当前时间信息
set-time **设定当前时间
set-timezone **设定当前时区
set-local-rtc **设定是否使用utc时间
[2.设备的发现]
fdisk -l **查看真实存在的设备
cat /proc/partitions **系统能够识别的设备
blkid **系统能够挂载使用的设备id
df **查看设备被系统使用的情况
[root@foundation49 ~]# fdisk -l
Disk /dev/sda: 500.1 GB, 500107862016 bytes, 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0xa4355ffb
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 104871935 52434944 7 HPFS/NTFS/exFAT
/dev/sda2 104871936 976773119 435950592 f W95 Ext'd (LBA)
Disk /dev/sdb: 31.0 GB, 31043616768 bytes, 60632064 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x217517eb
Device Boot Start End Blocks Id System
/dev/sdb1 * 8064 60632063 30312000 c W95 FAT32 (LBA)
[设备的使用]
1.设备的挂载
mount 设备 挂载点
mount /dev/sdb1 /mnt **把系统第二块硬盘的第一个分区挂载到/mnt目录上
2.卸载设备
umount 设备|挂载点
[2.软硬链接]
ls -i **查看文件节点号
ln -s /file /file1 **软链接
ln /file /file1 **硬链接
[3.文件查找]
1.locate filename **在文件数据库中搜索filename信息,updatedb更新文件数据库
2.find 查找位置 -条件 条件值 -exec动作 {} \;
-name
-user
-group
-size
-prem