@breakerthb
2017-03-15T07:21:13.000000Z
字数 1589
阅读 1390
Linux
Tips
host -> server
$ rz
server -> host
$ sz
安装:
$ yum install lrzsz
工具 -> 键盘映射
点击Print键,之后禁用。
ref:http://www.cnblogs.com/wanlxp/p/3788255.html
配置文件
$ vim /etc/rc.local
ref : https://www.zybuluo.com/breakerthb/note/688556
$ echo 1 > /proc/sys/vm/drop_caches
查看swap
swapon -s
关闭swap
$ swapoff -a //关闭全部
$ printf("111");无法及时显示,需要使用
$ printf("111\n");
$ sudo dpkg-reconfigure keyboard-configuration
$ fuser -km "path"
$ pgrep -f iostat | xargs kill -9
原因: ls -l which sh
提示/bin/sh -> dash
这说明是用dash来进行解析的。
改回方法:
$ sudo dpkg-reconfigure dash
在界面中选择no
再ls -l which sh
提示/bin/sh -> bash
进入单用户模式:
按shift进入
1、开机到grub时,用上下键移到第二行的恢复模式,按e(注意不是回车)
即Ubuntu,With Linux 3.2.0-23-generic(recovery mode)
2、把ro recovery nomodeset 改成rw single init=/bin/bash
date "+%Y-%m-%d %H:%M:%S"
系统盘迁移到其他机器时出现如下问题:
Cant find device "eth0"
/etc/udev/rules.d/70-persistent-net.rules 中 出现两个网卡。eth0 eth1
配置 新的 eth1
删掉eth0这条记录,把eth1改成eth0. 重启
Ubuntu为了加快开机速度,用dash代替了传统的bash
解决方法是取消dash
$ sudo dpkg-reconfigure dash
在选择项中选No,即可。
dash 好像是Debian的版本。
cygwin运行sh脚本出现如上错误,原因是脚本文件里使用的是\r\n,就是是windows下的回车换行,而不是linux系统里的换行。解决方法就是使用dos2unix命令。
本机安装的msysgit里有这个可执行文件,因此直接使用
$ dos2unix xxx.sh xxx.sh
之后执行sh脚本就没错了。
$ export no_proxy=127.0.0.1,109.105.112.0/24
$ elinks --dump http://127.0.0.1:8000
$ vim /etc/rsyslog.d/50-default.conf
其中有这么一段
*.=info;*.=notice;*.=warn;\
auth,authpriv.none;\
cron,daemon.none;\
mail,news.none -/var/log/messages
这是本来就有,却被注释了。现在解注释就行
保存后重启服务:
$ sudo restart rsyslog