
置頂隨筆
1、同步系統時間(可以用的)
1
/usr/sbin/ntpdate time.windows.com
2、查詢80端口被哪些程序占用
1
netstat -antp|grep 80
3、查看目錄下各自磁盤占用空間
1
du --max-depth=1 -h /appsvr/xjjhr_tomcat-5.5.20/jobhn2/ROOT
4、tar打包和解壓
1
tar -cvfz ***.tar /sourcefolder
2
tar -xvfz ***.tar -C targetfolder
5、編輯iptables
1
vi etc/sysconfig/iptables
6、rpm安裝、卸載、列表和查詢mysql安裝
1
rpm -ivh
2
rpm -ev --nodeps
3
rpm -ql xxx.rpm
4
rpm -qa|grep -i mysql
7、查看redhat版本
1
cat /etc/redhat_release
8、查看cpu速度
1
cat /proc/cpuinfo
9、刪除/data/projects/myproject/目錄(及其子目錄下)的所有.svn目錄
1
find /data/projects/myproject/ -name .svn |xargs rm -rf
10、修改網卡IP,并重啟
1
vi /etc/sysconfig/network-scripts/ifcfg-eth0
2
service network restart
11、查看tomcat日志文件的最后200行
1
tail -n 200 /apache_tomcat-5.5.20/logs/catalina.out
12、修改當前默認語言
1
export LANG=en_US
2
export LC_ALL=en_US
3
修改系統的:
4
cat ~/.bash_profile
13、安裝和卸載U盤
1
fdisk -l
2
mount /dev/sdc1 /mnt
3
umount /mnt
4
umount -l /mnt (等空閑后卸載)
14、修改系統啟動參數
1 vi ~/.bash_profile
2 vi /etc/rc.local
3 vi /etc/profile
4 修改后即時生效
5 . ~/.bash_profile
6 . /etc/rc.local
7 . /etc/profile
15、查看8100端口的訪問統計
1 netstat -na |grep 8100 |wc -l
2 netstat -tunlap|grep 80
16、修改系統時間
1 date -s "11/20/2003 12:48:00"
2 date +%Y%m%d%T -s "20081225 10:05:00"
17、查看系統IO瓶頸
1 sudo iotop -Pm /
posted @
2008-06-04 11:27 rox 閱讀(391) |
評論 (1) |
編輯 收藏