find /usr -size +10M
find /home -mtime +120
find . -ctime +3 -name '*.log' | rm -rf
[root@zabbix ~]# date
Fri Nov 9 19:36:22 CST 2018
[root@zabbix ~]# find / -ctime +4 -name '*20181104'
/var/log/secure-20181104
/var/log/httpd/error_log-20181104
/var/log/httpd/access_log-20181104
/var/log/messages-20181104
/var/log/samba/old/log.smbd-20181104
/var/log/zabbix/zabbix_agentd.log-20181104
/var/log/zabbix/zabbix_server.log-20181104
/var/log/cron-20181104
/var/log/spooler-20181104
/var/log/maillog-20181104
/backup/mysqldb/20181104
[root@zabbix ~]# who -r
run-level 3 2018-10-13 19:05
[root@zabbix ~]# runlevel
N 3
[root@zabbix ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 172.16.0.1 0.0.0.0 UG 100 0 0 eth0
169.254.169.254 172.16.0.3 255.255.255.255 UGH 100 0 0 eth0
172.16.0.0 0.0.0.0 255.255.240.0 U 100 0 0 eth0
[root@zabbix ~]# netstat -nr
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 172.16.0.1 0.0.0.0 UG 0 0 0 eth0
169.254.169.254 172.16.0.3 255.255.255.255 UGH 0 0 0 eth0
172.16.0.0 0.0.0.0 255.255.240.0 U 0 0 0 eth0
[root@zabbix ~]# rpm -qf /usr/bin/mysql
mysql-community-client-5.7.23-1.el7.x86_64
[root@zabbix ~]# ll
total 40
drwxr-xr-x 2 root root 4096 Oct 27 10:14 logs
drwxr-xr-x 2 root root 4096 Oct 27 09:54 logs?
-rw-r--r-- 1 root root 683 Oct 13 19:39 mysql_backup.sh
drwxrwxrwx 2 root root 4096 Oct 16 19:44 share
-rwxr-xr-x 1 root root 5282 Oct 23 19:37 sys_check.sh
-rwxr-xr-x 1 root root 5418 Oct 27 10:10 sys_check.sh_bak
drwxr--r-- 3 root root 4096 Oct 15 09:15 test
-rw-r--r-- 1 root root 25 Oct 25 16:31 test.txt
[root@zabbix ~]# ll | awk '{print $3,"owns",$9}'
owns
root owns logs
root owns logs
root owns mysql_backup.sh
root owns share
root owns sys_check.sh
root owns sys_check.sh_bak
root owns test
root owns test.txt
[root@zabbix ~]#
mount.cifs //IP地址/server /mnt/server -o user=administrator,password=123456
[root@zabbix ~]# cat /dev/urandom | head -1 | md5sum | head -c 8 > /pass
[root@zabbix ~]# cat /pass
3228d504
[root@zabbix ~]# cat adduser.sh
#!/bin/bash
#description: useradd
for i in `seq 60 65`
do
pwd=$(cat /dev/urandom | head -1 | md5sum | head -c 5)
useradd user$i
echo "user$i$pwd" | passwd --stdin user$i
echo user$i user$i$pwd >> userinfo.txt
done
[root@zabbix ~]#
[root@zabbix ~]# cat userinfo.txt
user60 user6092168
user61 user6162cd5
user62 user628da79
user63 user63bcd61
user64 user6423c2f
user65 user65d982b
[root@zabbix ~]# cat ping.sh
#!/bin/bash
for ip in `seq 1 255`
do
ping -c 1 192.168.1.$ip > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo 192.168.1.$ip UP
else
echo 192.168.1.$ip DOWN
fi
done
wait
[root@zabbix ~]#