James Rawson

#network config/monitor commands
netstat -cIeth0
sudo /sbin/ethtool -S eth0
sudo /sbin/ethtool -iv eth0
sudo /sbin/ethtool -i eth0
 vi /etc/sysconfig/network-scripts/ifcfg-eth0

#Show process list with tree structure showing ownsership
ps -ef --forest
ps -awwfx

#gather data on ports for host or hosts
# -v verbose
#  -A OS and version detection
#  -T[0-5]: Set timing template (higher is faster)
 nmap -v -A -T3 10.220.172.57

#remove files older than 5 days
find /my_current_directory -mtime +5 -exec rm {} \;

netstat -rn
   10  more /etc/sysconfig/networking/devices/ifcfg-eth1
   11  ls /etc/sysconfig/networking/devices/
#add default gw
 route add default gw 10.1.10.1
#determine release version
cat /etc/redhat-release
cat /etc/debian_version
uname -a
# find processor info
cat /proc/cpuinfo


#              Display a single history since boot report for all CPU and Devices.
       iostat
#              Display a continuous device report at two second intervals.
       iostat -d 2
#              Display six reports at two second intervals for all devices.
       iostat -d 2 6
#              Display six reports of extended statistics at two second intervals for devices hda and hdb.
       iostat -x hda hdb 2 6
#               Display six reports at two second intervals for device sda and all its partitions (sda1, etc.)
       iostat -p sda 2 6

#  You can try it out with -d to see what would happen:
logrotate -df /etc/logrotate.d/nginx
#  Then you can run (using nginx as an example),  and the nginx logs alone will be rotated.
logrotate -f /etc/logrotate.d/nginx
#truncate  a log
cat /dev/null > logfile