免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 384 | 回复: 0
打印 上一主题 下一主题

Linux command to gathers up information [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-12-25 11:27 |只看该作者 |倒序浏览
If you are developing an application for Linux desktop and would like
to automatically find out more information about system, use the
following commands in shell scripts to gather information about system.
Recently I was involved in project where I need to collect information
about running GUI, browser and other information such as disk space,
running kernel etc.
Find out KDE Desktop version:
konqueror --version
Find out Gnome Desktop version:
gnome-panel --version
Find out Mozilla browser version:
mozilla --version
Find out Firefox browser version:
firefox --version
Find out current Language:
set | egrep '^(LANG|LC_)'
Find out disk space usage:
df -h
Find/Estimate file space usage:
du -h
Find out version of Linux glibc:
ls -l /lib/libc-*.so /lib/libc.so*
Find out user limits:
ulimit -a
Find out installed device drivers (modules)
lsmod
Find out information about an X server:
xdpyinfo
It can find out:
  • Name of display:
  • Version number
  • Vendor     name (such as The XFree86 Project)
  • Vendor release number
  • And XFree86 version number

Find out information about Linux CPU
cat /proc/cpuinfo
Find out information about Linux Memory
cat /proc/meminfo
OR
free -m
OR
free -g
Find out user shell name:
ps -p $$ | tail -1 | awk '{ print $4 }'
Dump Linux kernel variables
/sbin/sysctl -a
Find out running Linux kernel version:
uname -mrs
uname -a
cat /proc/version
Dump or display memory information and swap information:
free -m
Network card and IP address information:
ifconfig -a
ifconfig -a|less
Debian / Ubuntu Linux network configuration file (all interface eth0,eth1,…ethN)
more /etc/network/interfaces
Redhat / CentOS / Fedora Linux  network configuration file (eth0)
more  /etc/sysconfig/network-scripts/ifcfg-eth0
Note replace eth1 for 2nd network card and so on.
Display routing information
route -n
route
Display list of all open ports
netstat -tulpn
View login related logs
tail -f /var/log/secure
vi /var/log/secure
grep 'something' /var/log/secure
View mail server  related logs
tail -f /var/log/maillog
vi /var/log/maillog
grep 'something' /var/log/maillog
Find how long the system has been running
uname
w
Show who is logged on and what they are doing
w
who
Display list of tasks
top
Display all running process
ps aux
ps aux | grep process-name
Display list of all installed software on Redhat / CentOS / Fedora
rpm -qa
rpm -qa | grep 'software-name'
rpm -qa | less
Display list of all installed software on Debian / Ubuntu
dpkg --list
http://www.cyberciti.biz/tips/linux-command-to-gathers-up-information-about-a-linux-system.html
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/4847/showart_449658.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP