Find查找和dhcp
1.find
find 目录 条件 条件值
1.find -name
find /etc/ -name passwd ##查找/etc下名字叫passwd的文件
2.find -user -group -a -o -not
find /mnt -group root ##查找组是root的文件
find /mnt -group root -a -user student ##两个条件都满足
find /mnt -group root -a -user studnet ##两个条件最少满足一个
find /mnt -not -group root ##不是root组的
3.find -perm
find /mnt -perm 444 ##u=4 g=4 0=4
find /mnt -perm -444 ##u含有4 并且 g含有4 并且 o含有4
find /mnt -perm /444 ##u含有4 或者 g含有4 或者 o含有4
find /mnt -perm -002 ##含有2
4.find -type -maxdepth -mindepth
find /etc -type l ##查找链接
find /var -type s ##套接字
find /dev -type d ##目录
find /dev -type b ##块
finde /dev -type f ##文件
find /dev -type p ##管道
find /dev -maxdepth 2 -mindepth 2 -type f ##查找/dev子目录中的file
find /etc -type f -exec cp {} /mnt \; ##:转译符 把etc下的文件cp 到/mnt 下
find / -group mail -type f -exec cp -rp {} /mnt \; ##把组是mail 的文件cp到/mnt下 (-p带文件权限-r带目录)
find -size
find -t
find -exec \;
软链接 1个节点对应多文件
硬链接 多个节点对一个文件 (复制,备份)
软连可以跨分区
dhcp
在server中
yum install dhcp -y ##安装dhcp
rpm -qc dhcp ##查看是否安装
vim /etc/dhcp/dhcpd.conf ##查看配置文件(空文件,有一个配置文件的example)
cp /usr/share/doc/dhcp*/dhcpd.conf.example /etc/dhcp/dhcpd.conf ##将配置文件的example cp 到配置文件
vim /etc/dhcp/dhcpd.conf ##修改配置文件
(27,28行注释。7,8行修改 域名 和 域名地址 172.25.254.250 , 32-34行 :修改网段和子网掩码,和给客户端IP范围
systemctl restart dhcpd ##重启dhcp服务
systemctl status dhcp.server ##查看是否正在运行
测试:
在客户端
systemctl restart network ##重启 network
查看 IP是否在 server给的范围内
在server端 less /var/lib/dhcpd/dhcpd.leases ##查看给的IP是否一致