If you are developing an application Linux Environment and would like to automatically find out more information about the system, use the following commands in shell scripts to get information about system.
Find out KDE Desktop version:
Find out KDE Desktop version:
konqueror --versionFind out Gnome Desktop version:
gnome-panel --version
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 -aFind out installed device drivers (modules)
lsmod
Find out information about Linux CPU
cat /proc/cpuinfoFind out information about Linux Memory
cat /proc/meminfo
OR
free -m
OR
free -gFind out user shell name:
ps -p $$ | tail -1 | awk '{ print $4 }'
Dump Linux kernel variables
/sbin/sysctl -aFind out running Linux kernel version:
uname -mrs uname -a cat /proc/versionDump or display memory information and swap information:
free -mNetwork card and IP address information:
ifconfig -a ifconfig -a|lessDebian / Ubuntu Linux network configuration file (all interface eth0,eth1,...ethN)
more /etc/network/interfacesRedhat / 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 informationroute -n routeDisplay list of all open ports
netstat -tulpnView login related logs
tail -f /var/log/secure vi /var/log/secure grep 'something' /var/log/secureView mail server related logs
tail -f /var/log/maillog vi /var/log/maillog grep 'something' /var/log/maillogFind how long the system has been running
uname wShow who is logged on and what they are doing
w whoDisplay list of tasks
topDisplay all running process
ps aux ps aux | grep process-nameDisplay list of all installed software on Redhat / CentOS / Fedora
rpm -qa rpm -qa | grep 'software-name' rpm -qa | lessDisplay list of all installed software on Debian / Ubuntu
dpkg --list
No comments:
Post a Comment