Linux Tips

modify file content

  • vi
check file content
  • cat

shutdown default firewall

[root@A cluster]# service iptables stop

modify hostname

[root@A cluster]# vi /etc/sysconfig/network

  • modify file content: HOSTNAME=[your ideal hostname]

[root@A cluster]# vi /etc/hosts

  • add below as an example (mylinux as hostname)

192.168.1.23 mylinux

  • reboot

[root@A cluster]# init 6 (or reboot) (reboot computer to take effect)

Delete Directory

[root@A cluster]# rm -fr [directory]

Copy through nodes

[root@A cluster]# scp root@B:[file(s)] [directory]
[root@A cluster]# scp [file(s)] root@B:[directory] 

Check GCC Version

[root@A ~]gcc --version

Kill Threads

[root@A ~]killall [thread name]

Pack a directory

[root@A ~]tar -cvf [pack name] [directory]

Disk Space

[root@A ~]df -lh

compress a file or files

[root@localhost logs]# tar -zcvf /target-directory/target.tar.gz catalina.out 

posted on 2011-11-07 16:19  snigoal  阅读(210)  评论(0编辑  收藏  举报