汇总ShortCuts

记录Linux平台及其上常用软件的快捷键。提升效率

通用

Fn+left/right: 在文本编辑时,移动cursor与行首/行尾
ctrl+left/right: 文本编辑时,以单词为单位移动cursor
上边移动cursor时按住shift: 选中cursor走过的内容

Linux

grep -n -H -r "CUDA_KERNEL_LOOP": 在当前路径下查找所有含有此关键字的文件,并显示文件名,行号。
tree -d: 显示文件夹树

Alt + F4: close current window
Alt + PrtSc: take screen shot on current window
Alt + F7: move current window
Alt + F8: use arrow to adjust the size of current window
Alt + arrows: move out or move in a directory\
Win + D : show desk

$ make clean: 清理编译内容
$ make all -j4: 使用4个线程编译
$ cp -r foldername ./: 将foldername中所有内容复制到 当期那目录
$ rm -t foldername: 删除foldername及其中所有内容.
$ systemctl suspend: suspend mode,保存当前工作内容与内存,按任意键唤醒
$ systemctl hybernate: 也是睡眠,保存当前工作内容,但要按电源键唤醒

$ sudo apt-get install -f: ?
$ sudo apt-get update: ?
$ sudo apt-get upgrade: ?

$ Libreoffice FILENAME.odt: open .odt file

$ ls | wc -l: the number of files in current path
$ ls -l | grep ^- | wc -l: the number of files in current directory
$ ls -l | grep ^d | wc -l: the number of directories in current directory

$ mv 'ls | head -1000' ../: move first 1000 files from current to upper level
$ find /opt/opencv/ -name "imgproc.hpp": find file in a directory
$ sudo dpkg -i FILENAME.deb : install .deb file
$ dpkg --list: show installed software in system
$ sudo apt-get --purge remove (name) :packages uninstall

$ df -lhT :info about disk
$ tar -zcvf 压缩包名.tar.gz 源文件: 压缩.tar.gz

$ git clone URL : GitHub url to current directory
$ git add FILENAME: 向remote添加新文件FILENAME
$ git commit -m "massage": make a commitment about that change
$ git push: 将本地的改变推入remote
$ git pull: 更新本地repository

$ ipython trust filename.ipynb: trust this notebook

$ source activate tensorflow: activate tensor environment
$ source deactivate: deactive that environment

$ which/whereis/type package: show where is that package

$ export PS1=’:> ’ change the prompt(shorten prompt when it is too long)
:> bash change back

$ xdg-open . : open the current directory in terminal
$ sudo apt-get install alacarte: 删除Linux中invalid app icon

Chrome & Firefox

Ctrl + Tab or Ctrl + PgDn: Jump to next open tab
Ctrl + Shift + Tab or Ctrl + PgUp: Jump to the previous open tab
Ctrl + t: New tab
Ctrl + w: close current tab
Ctrl + n: new windows

Terminal

ctrl + a:移动光标到头
ctrl + e:移动光标到尾
ctrl + u:删除光标所在行
ctrl + k:
ctrl + r:历史中搜索
!xxx: 调用最后一个以xxx开头的命令(当命令较长时)
export PS1="-->": 缩短命令行

Quake Terminal

ctrl+shift+t: new tab
ctrl+shift+w: close tab
ctrl+page up: go to previous tab
ctrl+page down: go to next tab

Ipython notebook (非Edit模式下)

b: add cell below
a: add cell above
1: change cell to head 1
2: change cell to head 2
Esc: change to command mode
Enter: change to edit mode
d+d: delete cell
Shift+l: show/close line numbers

Tmux

ctrl+b: pre-fix P
ctrl+b arrows: move around windows
ctrl+b %: split window l&r
ctrl+b ”: split window u&d
ctrl+b x: kill this split-screen
ctrl+b &: kill this window
kill-server : kill all sessions

For more info check here

Intellij

ctrl+shift+F7:for a specific variable, highlight them
F3: navigate among these variables.
ctrl+w: select word
Esc: quit highlights.

pycharm

ctrl+shift+-:折叠
ctrl+shift++:展开

Docker

$ Docker(rosslee:zhen0miaod):
$ sudo docker login: login my docker hub account

$ sudo docker images -a: show all downloaded images
$ sudo docker rmi <name|id>: delete downloaded image
$ sudo docker rmi $(docker images -a -q) : remove all images

$ sudo docker ps -a: list all containers
$ sudo docker rm <name|id>: remove containe

Visual studio 代码调试

  1. 跟踪变量,一步一步执行

F9: 在鼠标当前位置设置breakpoint。
F5:开始debug。在菜单栏中点击degug -> Windows -> autos。如此便可以看到每个变量的值随着调试的过程动态改变。
选中code中变量,右键->add watch: 将这个变量放入跟踪中。
Continue按钮:开始执行,到下一个breakpoint
F10: 不同与continue,这个是一句一句执行,可以跟踪临时变量。但是这回跳过子函数。
F11:一句一句执行,回进入子函数。

  1. run without debugging

ctrl+F5