随笔-46  评论-54  文章-0  trackbacks-0
1、同步系统时间(可以用的)
1/usr/sbin/ntpdate time.windows.com
2、查询80端口被哪些程序占用
1netstat -antp|grep 80
3、查看目录下各自磁盘占用空间
1du --max-depth=1 -h /appsvr/xjjhr_tomcat-5.5.20/jobhn2/ROOT
4、tar打包和解压
1tar -cvfz ***.tar /sourcefolder
2tar -xvfz ***.tar -C targetfolder
5、编辑iptables
1vi etc/sysconfig/iptables
6、rpm安装、卸载、列表和查询mysql安装
1rpm -ivh 
2rpm -ev --nodeps
3rpm -ql xxx.rpm
4rpm -qa|grep -i mysql
7、查看redhat版本
1cat /etc/redhat_release
8、查看cpu速度
1cat /proc/cpuinfo
9、删除/data/projects/myproject/目录(及其子目录下)的所有.svn目录
1find /data/projects/myproject/ -name .svn |xargs rm -rf
10、修改网卡IP,并重启
1vi /etc/sysconfig/network-scripts/ifcfg-eth0
2service network restart
11、查看tomcat日志文件的最后200行
1tail -200 /apache_tomcat-5.5.20/logs/catalina.out
12、修改当前默认语言
1export LANG=en_US
2export LC_ALL=en_US
3修改系统的:
4cat ~/.bash_profile
13、安装和卸载U盘
1fdisk -l
2mount /dev/sdc1 /mnt
3umount /mnt
4umount -/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 on 2008-06-04 11:27 rox 阅读(379) 评论(1)  编辑  收藏

评论:
# re: 一些常用的linux命令 2010-03-10 13:38 | rox
补充和参考:
linux通过ntpdate网络校时
http://hi.baidu.com/bubu600/blog/item/e299aa595a2709212834f0ae.html
crontab -e
10 5 * * * root ntpdate 192.168.0.2 ;hwclock -w
这样每天5:10自动进行网络校时


linux时间同步操作
http://bbs.linuxpk.com/viewthread.php?tid=27911
使用了端口 123
iptables -I INPUT -p udp -m udp --sport 123 -j ACCEPT

Centos 时间同步
http://www.javaeye.com/topic/599648
中国国家授时中心:
http://www.time.ac.cn/stime.asp

其他网络时间服务器地址如下:(也可以自己去搜索下)

time.nist.gov (美国)
ntp.fudan.edu.cn (复旦) )(国内用户推荐使用此服务器)
timekeeper.isi.edu
subitaneous.cpsc.ucalgary.ca
usno.pa-x.dec.com
time.twc.weather.com
swisstime.ethz.ch
ntp0.fau.de
ntp3.fau.de
time-a.nist.gov
time-b.nist.gov
time-nw.nist.gov
nist1-sj.glassey.com

210.72.145.44 也是一个不错的地址,速度很快!
  回复  更多评论
  

只有注册用户登录后才能发表评论。


网站导航: