1. 程式人生 > >Linux下終端的快捷鍵及建立開啟終端的快捷鍵

Linux下終端的快捷鍵及建立開啟終端的快捷鍵

Linux終端使用技巧

關鍵字: linux 終端

今天才發現Linux下的終端有這麼多好用的快捷鍵。

Shift+Ctrl+T:新建標籤頁

Shift+Ctrl+W:關閉標籤頁

Ctrl+PageUp:前一標籤頁

Ctrl+PageDown:後一標籤頁

Shift+Ctrl+PageUp:標籤頁左移

Shift+Ctrl+PageDown:標籤頁右移

Alt+1:切換到標籤頁1

Alt+2:切換到標籤頁2

Alt+3:切換到標籤頁3

Shift+Ctrl+N:新建視窗

Shift+Ctrl+Q:關閉終端

終端中的複製/貼上:

Shift+Ctrl+C:複製

Shift+Ctrl+V:貼上

終端改變大小:

F11:全屏

Ctrl+plus:放大

Ctrl+minus:減小

Ctrl+0:原始大小


建立開啟終端的快捷鍵

一、設定快捷鍵

首選項---螢幕快捷鍵,然後新增一個命令,並新增一個你的快捷鍵,如果你用的是gnome桌面建議用 

gnome-terminal命令新增快捷鍵,也可以用xterm,還可以用shell指令碼,比如我用的是呼叫下面我貼的一個指令碼

命令(指令碼見文程式碼):/home/zhangwei/.gnome2/nautilus-scripts/開啟終端

二、設定右鍵快捷鍵(開啟時為當前目錄)

方法一:

執行命令:sudo apt-get install nautilus-open-terminal

此方法是安裝一個小軟體,但是我安裝後和conky衝突了,所以沒有用。

方法二:

用指令碼,把下面的指令碼儲存成任意名(我的是:開啟終端),然後放在主目錄的.gnome2/nautilus-scripts目錄下,當然你可以放一些其他常見的指令碼,都可以在右鍵找到。比如傳送到郵件/修改檔案許可權等等實用的功能。

指令碼:

#!/bin/bash
#
# This script opens a gnome-terminal in the directory youselect.
#
# Distributed under the terms of GNU GPL version 2 or later
#
# Install in ~/.gnome2/nautilus-scripts or ~/Nautilus/scripts
# You need to be running Nautilus 1.0.3+ to use scripts.

# When a directory is selected, go there. Otherwise go tocurrent
# directory. If more than one directory is selected, showerror.
if [ -n "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" ]; then
set $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
if [ $# -eq 1 ]; then
destination="$1"
# Go to file's directory if it's a file
if [ ! -d "$destination" ]; then
destination="`dirname "$destination"`"
fi
else
zenity --error --title="Error - Open terminal here" \
--text="You can only select one directory."
exit 1
fi
else
destination="`echo "$NAUTILUS_SCRIPT_CURRENT_URI" | sed's/^file:\/\///'`"
fi

# It's only possible to go to local directories
if [ -n "`echo "$destination" | grep '^[a-zA-Z0-9]\+:'`" ];then
zenity --error --title="Error - Open terminal here" \
--text="Only local directories can be used."
exit 1
fi

cd "$destination"
exec x-terminal-emulator