首页 > 代码库 > linux常用命令备忘

linux常用命令备忘

杀掉多个进程

ps -ef | grep tornado_service | grep -v grep | cut -c 9-15 | xargs kill -s 9

清空内存缓存

echo 3 > /proc/sys/vm/drop_caches

查找大文件或目录

du -s * | sort -nr | head

sudo su 配置

apt-get install sudo

chmod 777 /etc/sudoers

vi /etc/sudoers

zhangxl  ALL=NOPASSWD: ALL

chmod 440 /etc/sudoers

两台机器传递文件

发送:

    scp all.tar zhangxl@10.23.36.311:/home/zhangxl/m   passport

获取:

    sftp zhangxl@192.168.1.123

    get  abc.jpg

静态ip设置

vi /etc/network/interfaces

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
    address 192.168.0.188
    netmask 255.255.255.0
    network 192.168.0.0
    broadcast 192.168.0.255
    gateway 192.168.0.1
    dns-nameservers 219.141.136.10

开启关闭syslog

syslog /etc/init.d/rsyslog stop

syslog /etc/init.d/rsyslog start

linux常用命令备忘