find命令及dhcp服务

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服务

 [root@dream dream_ya]# yum install dhcp -y  
 [root@dream 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
 [root@dream 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
 #
 [root@dream dream_ya]# cp /usr/share/doc/dhcp*/dhcpd.conf.example /etc/dhcp/dhcpd.conf      ###把范例拷贝过来
 cp: overwrite ‘/etc/dhcp/dhcpd.conf’? y 
 [root@dream 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

这里写图片描述

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

可以发现ip变为101了

这里写图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Wielun

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值