编程知识 cdmana.com

Some common linux commands

System

see redhat edition

cat /etc/redhat-release
uname -a
cat /proc/version

Check the system startup parameters

cat ~/.bash_profile

Modify system startup parameters

vi ~/.bash_profile
vi /etc/rc.local
vi /etc/profile

The amendment will take effect immediately

. ~/.bash_profile
. /etc/rc.local
. /etc/profile

Synchronization system time

/usr/sbin/ntpdate time.windows.com

Modify system time

date -s "11/20/2003 12:48:00"
date +%Y%m%d%T -s "20081225 10:05:00"

see cpu Information

cat /proc/cpuinfo

Check the system IO bottleneck

sudo iotop -Pm /

Check the space occupied by each disk in the directory

du --max-depth=1 -h /apps/tomcat8/ROOT

rpm install 、 uninstall 、 Lists and queries mysql install

rpm -ivh
rpm -ev --nodeps
rpm -ql xxx.rpm
rpm -qa|grep -i mysql

The Internet

Inquire about 80 Which programs occupy the port

netstat -antp|grep 80

see 8100 Port access statistics

netstat -na |grep 8100 |wc -l
netstat -tunlap|grep 80

edit iptables

vi etc/sysconfig/iptables

Modify NIC IP, And restart

vi /etc/sysconfig/network-scripts/ifcfg-eth0
service network restart

Tools

tar Packaging and decompression

tar -cvfz ***.tar /sourcefolder
tar -xvfz ***.tar -C targetfolder

see tomcat At the end of the log file 200 That's ok

tail -n 200 /apache_tomcat-5.5.20/logs/catalina.out

Modify the current default language

export LANG=en_US
export LC_ALL=en_US

Delete /data/projects/myproject/ Catalog ( And its subdirectories ) All of the .svn Catalog

find /data/projects/myproject/ -name .svn |xargs rm -rf

load and unload U disc

fdisk -l
mount /dev/sdc1 /mnt
umount /mnt
umount -l /mnt ( Unload when idle )

版权声明
本文为[Static wind flow cloud]所创,转载请带上原文链接,感谢

Scroll to Top