欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

find命令及dhcp服务

程序员文章站 2022-05-13 11:15:14
...

find命令

 find   查找位置    -条件 条件值  |xargs -i 动作 {} 
 find   查找位置    -条件 条件值  -exec 动作 {} \; 
            -name
            -not    条件
            -user
            -group
            -size
            -perm
            -maxdepth
            -mindepth
            -a
            -o
            -type   f   文件
                d   目录
                c   字符设备
                b   块设备
                s   套节字
                l   链接
 find /mnt -user student
 find /mnt -group linux 
 find /mnt -user student -a -group linux
 find /mnt -user student -o -group linux
 find /mnt -user student -a -group linux
 find /mnt -user student 
 find /mnt -user student -a -not -group linux
 find /mnt -perm 444                                         ###u=4,g=4,o=4刚好
 find /mnt -perm -444                                        ###u=4,g=4,o=4同时含有
 find /mnt -perm -002
 find /mnt -perm /444  |版本6用的+                            ###u=4,g=4,o=4满足一个                      
 dd if=/dev/zero of=./file bs=1M count=100
 dd if=/dev/zero of=./file1 bs=1M count=200
 dd if=/dev/zero of=./file1 bs=1M count=300
 dd if=/dev/zero of=./file2 bs=1M count=200
 ll -h
 find ./ -size 200M                                          ###200M的文件
 find ./ -size +200M                                         ###大于200M的
 find ./ -size -200M                                         ###小于200M的

 find /etc -maxdepth 2 -mindepth 2 -type l                   ###只要2层的

 find / -group mail -type f -exec cp {} /mnt \;
 find / -group mail -type f -exec cp {} /mnt ";"
 find / -group mail -type f |xargs -i cp {} /mnt

dhcp服务

 [aaa@qq.com dream_ya]# yum install dhcp -y  
 [aaa@qq.com dream_ya]# rpm -qc dhcp                        ###查看生成的文件
 /etc/dhcp/dhcpd.conf                                       
 /etc/dhcp/dhcpd6.conf
 /etc/openldap/schema/dhcp.schema
 /etc/sysconfig/dhcpd
 /var/lib/dhcpd/dhcpd.leases
 /var/lib/dhcpd/dhcpd6.leases
 [aaa@qq.com dream_ya]# cat /etc/dhcp/dhcpd.conf
 #
 # DHCP Server Configuration file.
 #   see /usr/share/doc/dhcp*/dhcpd.conf.example
 #   see dhcpd.conf(5) man page
 #
 [aaa@qq.com dream_ya]# cp /usr/share/doc/dhcp*/dhcpd.conf.example /etc/dhcp/dhcpd.conf      ###把范例拷贝过来
 cp: overwrite ‘/etc/dhcp/dhcpd.conf’? y 
 [aaa@qq.com dream_ya]# vim /etc/dhcp/dhcpd.conf
  7 option domain-name "dream.com";
  8 option domain-name-servers 172.25.254.110;              ###DNS
  27 #subnet 10.152.187.0 netmask 255.255.255.0 {
  28 #}
  32 subnet 172.25.254.0 netmask 255.255.255.0 {
  33   range 172.25.254.100 172.25.254.105;                 ###生成100-110
  34   option routers 172.25.254.100;                       ###网关               
  35 }

35行之后全部删除 d+G

 [root@dream dream_ya]# systemctl restart dhcpd

打开另外一台虚拟机,网卡设置成dhcp

find命令及dhcp服务

 33   range 172.25.254.101 172.25.254.105;
 [root@dream dream_ya]# systemctl restart dhcpd    

可以发现ip变为101了

find命令及dhcp服务