RucLinux system information

2014年03月14日

原创内容,转载请注明出处:https://www.myzhenai.com.cn/post/1777.html https://www.myzhenai.com/thread-16179-1-1.html
这是写的一个shell脚本,获取linux系统的信息并保存为一个php文件.方法其实很简单.将以下内容保存为script.sh文件即可.
演示:https://www.dropbox.com/s/qlt4e6jwuy3tbzj/sinof.php

# !/bin/bash
rm -rf sinof.php
echo "" >> sinof.php
echo "" >> sinof.php
echo 'RucLinux system information script' >> sinof.php
echo "" >> sinof.php
echo 'myzhenai.com.cn  myzhenai.com haikou-china.com jiayu.mybabya.com
' >> sinof.php echo "The local time:
" >> sinof.php date -u >> sinof.php echo "
" >> sinof.php echo "The current working directory:
" >> sinof.php pwd >> sinof.php echo "
" >> sinof.php echo "Kernel/operating system/CPU Information:
" >> sinof.php uname -a >> sinof.php echo "
" >> sinof.php echo "Kernel version:
" >> sinof.php cat /proc/version >> sinof.php echo "
" >> sinof.php echo "Operating System Version:
" >> sinof.php cat /etc/issue >> sinof.php echo "
" >> sinof.php echo "CPU information:
" >> sinof.php cat /proc/cpuinfo >> sinof.php echo "
" >> sinof.php echo "Loaded kernel modules:
" >> sinof.php lsmod >> sinof.php echo "
" >> sinof.php echo "Environment variables:
" >> sinof.php env >> sinof.php echo "
" >> sinof.php echo "Memory usage:
" >> sinof.php free -m >> sinof.php echo "
" >> sinof.php echo "The amount of memory:
" >> sinof.php grep MemTotal /proc/meminfo >> sinof.php echo "
" >> sinof.php echo "Free memory:
" >> sinof.php grep MemFree /proc/meminfo >> sinof.php echo "
" >> sinof.php echo "System uptime:
" >> sinof.php uptime >> sinof.php echo "
" >> sinof.php echo "All partitions:
" >> sinof.php fdisk -l >> sinof.php echo "
" >> sinof.php echo "All swap partitions:
" >> sinof.php swapon -s >> sinof.php echo "
" >> sinof.php echo "All network interfaces:
" >> sinof.php ifconfig >> sinof.php echo "
" >> sinof.php echo "Routing table:
" >> sinof.php route -n >> sinof.php echo "
" >> sinof.php echo "All listening ports:
" >> sinof.php netstat -lntp >> sinof.php echo "
" >> sinof.php echo "Connection has been established:
" >> sinof.php netstat -antp >> sinof.php echo "
" >> sinof.php echo "Network Statistics processes:
" >> sinof.php netstat -s >> sinof.php echo "
" >> sinof.php echo "All processes:
" >> sinof.php ps -ef >> sinof.php echo "
" >> sinof.php echo "Active users:
" >> sinof.php w -s >> sinof.php echo "
" >> sinof.php echo "User login log:
" >> sinof.php last >> sinof.php echo "
" >> sinof.php echo "All users of the system:
" >> sinof.php cut -d: -f1 /etc/passwd >> sinof.php echo "
" >> sinof.php echo "All group:
" >> sinof.php cut -d: -f1 /etc/group >> sinof.php echo "
" >> sinof.php echo "Plan of the current user:
" >> sinof.php crontab -l >> sinof.php echo "
" >> sinof.php echo "All system services:
" >> sinof.php chkconfig --list >> sinof.php echo "
" >> sinof.php echo "All activated system service:
" >> sinof.php chkconfig --list |grep on >> sinof.php echo "
" >> sinof.php echo "All software installed packages:
" >> sinof.php rpm -qa >> sinof.php echo "
" >> sinof.php echo "All installed PHP software package:
" >> sinof.php rpm -qa |grep php >> sinof.php echo "
" >> sinof.php echo "PHP information:
" >> sinof.php php -v >> sinof.php echo "
" >> sinof.php echo "All php.ini file path:
" >> sinof.php find / -name php.ini >> sinof.php echo "
" >> sinof.php echo "All httpd.conf file path:
" >> sinof.php find / -name httpd.conf >> sinof.php echo "
" >> sinof.php echo "All lighttpd.conf file path:
" >> sinof.php find / -name ligbttpd.conf >> sinof.php echo "
" >> sinof.php echo "All nginx.conf file path:
" >> sinof.php find / -name nginx.conf >> sinof.php echo "
" >> sinof.php echo "All php-fpm.conf file path:
" >> sinof.php find / -name php-fpm.conf >> sinof.php echo "
" >> sinof.php echo "The current system of open files:
" >> sinof.php lsof -i >> sinof.php echo "
" >> sinof.php echo "Find the ASP file:
" >> sinof.php find / -name *.asp >> sinof.php echo "
" >> sinof.php echo "Volume files larger than 10M:
" >> sinof.php find / -size +10M >> sinof.php echo "
" >> sinof.php echo "" >> sinof.php echo "" >> sinof.php echo "" >> sinof.php chmod 777 sinof.php

 


sicnature ---------------------------------------------------------------------
Your current IP address is: 18.234.255.5
Your IP address location: 美国 弗吉尼亚州阿什本amazon数据中心 其它参考数据(埃文科技提供)
Your IP address country and region: 美国 美国
Your current browser is:
Your current system is:
Original content, please indicate the source:
同福客栈论坛 | 蟒蛇科普海南乡情论坛 | JiaYu Blog
sicnature ---------------------------------------------------------------------
Welcome to reprint. Please indicate the source https://www.myzhenai.com.cn/post/1777.html

没有评论

发表评论

电子邮件地址不会被公开。 必填项已用*标注