linux关闭触摸板命令快捷键和脚本命令
学习了一些linux的快捷键和脚本命令
关闭触摸板命令:sudo modprobe -r psmouse
如果打开触摸板就是:sudo modprobe psmouse
synclient touchpadoff=1
#从图形目录进入终端
1、命令行:sudo apt-get install nautilus-open-terminal
2、重新加载文件管理器:nautilus -q
3、如果执行以上指令后在文件夹中右键还没有open in terminal选项的话就重启就好了。
我的是执行上以上指令就可以在文件夹中右键打开open in terminal选项了
#快捷键:
ALT+TAB //change window
ALT+~//change between sub windows
ctrl+ alt+t // create a new terminal
ctrl+ shift+t // create a new terminal based on the orginal terminal, very cool
alt+1 alt+2 alt+3 // change to the sub terminal 1or 2 or 3
#脚本命令,learn from 51cto, Mr.hu shuai
exec:
#sudo shutdown -h +200
#sudo shutdown -h 22:40
#sudo gedit /etc/network/interfaces
#cd /home/rong/project/tutorial/; pwd;./main1
#x-www-browser 'http://baidu.com'
#nautilus /home/rong.project
gnome-terminal -x bash -c "echo open candump; candump can0;exec bash;"
a=$(whoami)
echo $a
清空原文件:> test.txt
重定向:seq 10 //standard I/O
seq 1 2 10
0 1 2 //standard error
seq 10 > test.txt// 会清空原文件
追加重定向:seq 6 >>test.txt
管道:cat test.txt | grep wlan0
seq 10 |head -9 |head -5
history > history.txt
cat history.txt | cut -d' ' -f2
cat history.txt | awk'{print $2}'
获取前十个常用命令排序:history | awk '{print $2}' | sort| uniq -c | sort -nr|head 10
获取前十个命令:history 10
别名:alias 'cls=clear '
unalias
永久改变别名:gedit /etc/profile
本用户开机生效:gedit .bashrc
加载:source .bashrc
加载简写:. .bashrc
命令行录制:script -a action.log -t 2> time.log
命令行录制结束:ctrl+D
命令行录制播放:scriptreplay time.log action.log
数学计算:expr $a +$b
expr $a \* $b
自加减:let a=a+1
内置命令: echo $((1/2))
echo $((1*2))
echo $((1%2))
伪随机数(4-5位):echo $RANDOM
伪随机数(0-9):echo $($RANDOM%10)
伪随机数(0-11):echo $($RANDOM%10+2)
产生10000个伪随机数: for i in 'seq 10000';do echo $RANDOWM >> 1.txt
查看文件行数:cat 1.txt |wc -l
6位随机密码:echo $RANDOW| md5sum|cut -c 1-6
任务中止: ctrl+z
查看停止进程:jobs
重新开始:fg bg
三种括号:()[]{}
() 父与子
[]任意字符
同时创建多个文件(序列):touch test{1..9}
touch test{a..f}
备份:cp temp.sh emp.sh.bak
快速备份:cp temp.sh{,.bak}
环境变量: echo $PATH
语言查看:echo $LANG
查看上一个返回值:echo $?
更改终端显示: PS1='temp:\$'
快速编辑文本,支持tab补全:cat >> Memo-lr << EOF
统计文line数: cat Memo-lr |wc -l
uniq去重:cat Memo-lr |sort|uniq -c
直接统计文本:wc Memo-lr
统计某个字符:grep ^1111$
替换字符:cat Memo-lr |tr '1' '0'
将ip地址赋值给ip这个变量:ip=$(ifconfig wlan0 | grep 'inet addr'|cut -d':' -f2 | cut -d' ' -f1)