ubuntu 键盘快捷键
We’re always looking for new ways to speed up everyday tasks in Ubuntu. We’ll show you some keyboard shortcuts you might not have known about, and show you how to make your own custom shortcuts.
我们一直在寻找新的方法来加快Ubuntu中的日常任务。 我们将向您展示一些您可能不了解的键盘快捷键,并向您展示如何制作自己的自定义快捷键。
当键盘统治地球 (When Keyboards Ruled the Earth)
Unix—the spiritual predecessor of Linux—predates graphical user interfaces. The keyboard was the only game in town, so it was typing all the way. No surprise then, that functionality was soon introduced for the benefit of the computer operators of yesteryear.
Unix(Linux的精神前身)早于图形用户界面。 键盘是镇上唯一的游戏,因此一直在打字。 毫不奇怪,该功能很快就为过去的计算机操作员带来了好处。
Features such as the history
command and aliases started to appear in Unix shells. Their purpose was to increase productivity by reducing repetition and removing the need to remember obscure sequences of commands.
history
命令和别名之类的功能开始出现在Unix shell中。 他们的目的是通过减少重复和消除记住晦涩的命令序列来提高生产率。
Keyboard shortcuts boost efficiency, too. These are neat combinations of keystrokes that trigger some useful action for us. They don’t type text, they cause something to happen.
键盘快捷键也可以提高效率。 这些是击键的巧妙组合,可为我们触发一些有用的操作。 他们不输入文字,他们导致某些事情发生。
We’re going to look at some of the more useful Ubuntu keyboard shortcuts, both for the terminal and on Ubuntu’s GNOME Shell desktop. We’ll also demonstrate how to create your own shortcuts by applying the keystrokes of your choice to the action you want to perform. We tested this keyboard shortcuts on Ubuntu 19.04 Disco Dingo.
我们将在终端和Ubuntu的GNOME Shell桌面上查看一些更有用的Ubuntu键盘快捷键。 我们还将演示如何通过将您选择的按键应用于您要执行的操作来创建自己的快捷方式。 我们在Ubuntu 19.04 Disco Dingo上测试了此键盘快捷键。
超级什么? (Super What?)
The Super key is the one between the Ctrl and Alt keys toward the bottom left corner of the keyboard. On most keyboards, this will have a Windows symbol on it—in other words, “Super” is an operating system-neutral name for the Windows key. We’ll be making good use of the Super key.
超级键是键盘左下角的Ctrl和Alt键之间的键。 在大多数键盘上,其上将带有Windows符号-换句话说,“超级”是Windows键的与操作系统无关的名称。 我们将充分利用Super键。
终端的键盘快捷键 (Keyboard Shortcuts for the Terminal)
The following keyboard shortcuts work in GNOME Terminal—Ubuntu’s built-in terminal application. If they don’t seem to work, click menu > Preferences > Shortcuts in a Terminal window and ensure “Enable Shortcuts” is checked.
以下键盘快捷键在GNOME终端(Ubuntu的内置终端应用程序)中有效。 如果它们似乎不起作用,请在“终端”窗口中单击菜单>首选项>快捷方式,并确保选中“启用快捷方式”。
Use these keyboard shortcuts to speed up your Linux command line experience:
使用以下键盘快捷键可以加快Linux命令行体验:
打开和关闭终端窗口 (Opening and Closing Terminal Windows)
Ctrl+Alt+T or Shift+Ctrl+N: Open a terminal window.
Ctrl + Alt + T或Shift + Ctrl + N : 打开一个终端窗口。
Shift+Ctrl+Q: Close the current terminal window
Shift + Ctrl + Q:关闭当前终端窗口
终端窗口选项卡(Terminal Window Tabs)
Shift+Ctrl+T: Open a new tab.
Shift + Ctrl + T:打开一个新标签。
Shift+Ctrl+W Close the current tab.
Shift + Ctrl + W关闭当前选项卡。
Ctrl+Page Up: Switch to the previous tab.
Ctrl + Page Up :切换到上一个选项卡。
Ctrl+Page Down: Switch to the next tab.
Ctrl + Page Down:切换到下一个选项卡。
Shift+Ctrl+Page Up: Move to the tab to the left.
Shift + Ctrl +向上翻页:移到左侧的标签。
Shift+Ctrl+Page Down: Move to the tab to the right.
Shift + Ctrl + Page Down :移至右侧的标签。
Alt+1: Switch to Tab 1.
Alt + 1 :切换到标签1。
Alt+2: Switch to Tab 2.
Alt + 2 :切换到标签2。
Alt+3: Switch to Tab 3, and so on, up to Alt+9 to switch to tab 9
Alt + 3 :切换到选项卡3,依此类推,直到Alt + 9切换到选项卡9
Alt+0: Switch to Tab 10.
Alt + 0 :切换至标签10。
命令行编辑 (Command Line Editing)
Shift+Ctrl+C: Copy the highlighted text. You must use the mouse to highlight the text.
Shift + Ctrl + C:复制突出显示的文本。 您必须使用鼠标突出显示文本。
Shift+Ctrl+V: Paste the copied text in a terminal window. If you are pasting into an application such as an editor, Ctrl+V will probably work.
Shift + Ctrl + V:将复制的文本粘贴到终端窗口中。 如果要粘贴到诸如编辑器之类的应用程序中,则Ctrl + V可能会起作用。
Ctrl+A or Home: Go to the start of a command line.
Ctrl + A或Home :转到命令行的开头。
Ctrl+E or End: Go to the end of a command line.
Ctrl + E或End :转到命令行的末尾。
Alt+B or Ctrl+Left Arrow: Move the cursor backward one word.
Alt + B或Ctrl +向左箭头:将光标向后移动一个单词。
Ctrl+B or Left Arrow: Move the cursor backward one character.
Ctrl + B或向左箭头:将光标向后移动一个字符。
Alt+F or Ctrl+Right Arrow: Move the cursor forward one word.
Alt + F或Ctrl +向右键:将光标向前移动一个单词。
Ctrl+F or Right Arrow: Move the cursor forward one character.
Ctrl + F或向右箭头:将光标向前移动一个字符。
Ctrl+XX: Hop between the current position of the cursor and the start of the line. Hold down Ctrl and Press X twice, quickly.
Ctrl + XX :在光标的当前位置和行的开头之间跳转。 按住Ctrl并快速按两次X。
Ctrl+D or Delete: Delete the character under the cursor.
Ctrl + D或Delete :删除光标下方的字符。
Ctrl+U: Delete all characters before the cursor. Ctrl+E, Ctrl+U will delete the entire line.
Ctrl + U :删除光标之前的所有字符。 Ctrl + E , Ctrl + U将删除整行。
Alt+D: Delete all characters after the cursor to the end of the line.
ALT + d:光标移动到行的结尾后删除所有字符。
Ctrl+H or Backspace: Delete the character before the cursor.
Ctrl + H或Backspace :删除光标之前的字符。
控制终端显示 (Controlling The Terminal Display)
Ctrl+L: Clear the terminal window. Same as typing
clear
.Ctrl + L :清除终端窗口。 与键入
clear
相同。Ctrl+S: Stop scrolling output. Freezes the output from a program, but allows the program to continue to run in the background.
Ctrl + S :停止滚动输出。 冻结程序的输出,但允许程序继续在后台运行。
Ctrl+Q: Restart scrolling output if it has been stopped with Ctrl+S.
Ctrl + Q :如果已使用Ctrl + S停止滚动输出,则重新开始滚动输出。
缩放终端窗口 (Zooming the Terminal Window)
Shift+Ctrl++ (that is, Shift, Ctrl and +, “the plus sign”): Zoom in.
Shift + Ctrl ++ (即Shift , Ctrl和+, “加号”):放大。
Ctrl+- (that is, Shift, Ctrl and -, “the minus sign“): Zoom out.
Ctrl +- (即Shift , Ctrl和-,“减号” ):缩小。
F11: Full screen.
F11 :全屏。
Ctrl+0 (that is, Ctrl and 0, “zero”): Return to normal size.
Ctrl + 0 (即Ctrl和0 ,“零”):返回正常大小。
在终端窗口中搜索 (Searching in a Terminal Window)
Shift+Ctrl+F: Find.
Shift + Ctrl + F键:查找。
Shift+Ctrl+G: Find the next occurrence of the search term.
Shift + Ctrl + G :查找搜索词的下一个匹配项。
Shift+Ctrl+H: Find the previous occurrence of the search term.
Shift + Ctrl + H :查找搜索词的上一个匹配项。
Shift+Ctrl+J: Clear text highlights.
Shift + Ctrl + J :清除文本突出显示。
For more keyboard shortcuts, check out our list of Bash shortcuts—these work in any Linux terminal, even outside of the desktop.
有关更多键盘快捷键的信息,请查看我们的Bash快捷键列表,这些快捷键可以在任何Linux终端中使用,甚至可以在桌面之外使用。
桌面键盘快捷键 (Desktop Keyboard Shortcuts)
Ubuntu’s GNOME desktop environment offers many different keyboard shortcuts for navigating your desktop and working with windows, too. If you’re still doing all these things the long mouse-driven way, stop!
Ubuntu的GNOME桌面环境提供了许多不同的键盘快捷键,用于浏览桌面和使用Windows。 如果您仍然要以鼠标驱动的方式进行所有这些操作,请停止!
Alt+F2: Run a command. Opens the “Enter a Command” dialog. You can use this to launch applications, run commands, and run scripts.
Alt + F2 :运行命令。 打开“输入命令”对话框。 您可以使用它来启动应用程序,运行命令和运行脚本。
Super+D: Minimizes all windows and shows the desktop.
Super + D :最小化所有窗口并显示桌面。
Super+Tab or Alt+Tab: Switch applications.
Super + Tab或Alt + Tab :切换应用程序。
Ctrl+Alt+Up Arrow: Move to the previous workspace.
Ctrl + Alt +向上箭头:移至上一个工作区。
Ctrl+Alt+Down Arrow: Move to the next workspace.
Ctrl + Alt +向下箭头:移至下一个工作区。
Shift+Ctrl+Alt+Up Arrow: Move an application to the previous workspace.
Shift + Ctrl + Alt +向上箭头:将应用程序移动到上一个工作区。
Shift+Ctrl+Alt+Down Arrow: Move an application to the next workspace.
Shift + Ctrl + Alt +向下箭头:将应用程序移动到下一个工作区。
Super+Left Arrow: Snap the current application so that it takes up the left side of the screen.
Super + Left Arrow :捕捉当前应用程序,使其占据屏幕的左侧。
Super+Right Arrow: Snap the current application so that it takes up the right side of the screen.
Super + Right箭头:对齐当前应用程序,使其占据屏幕的右侧。
Super+Up Arrow: Maximize the current application.
Super +向上箭头:最大化当前应用程序。
Super+Down Arrow: Restore down (that is, reduce but don’t minimize) the current application.
Super + Down箭头:还原(即减少但不要最小化)当前应用程序。
Super+M or Super+V: Display the notifications are and Calendar.
Super + M或Super + V :显示通知为和日历。
Super+Space: Switches between input sources. For example, if you have a laptop with a US keyboard and you also use it with an external UK keyboard, you’d find this useful.
Super + Space :在输入源之间切换。 例如,如果您有一台带有美式键盘的笔记本电脑,并且还与一台外接式英国键盘一起使用,那么您会发现这很有用。
Ctrl+Alt+L: Locks the screen so that you need to log back in. Makes it safe to leave your computer unattended.
Ctrl + Alt + L :锁定屏幕,以便您需要重新登录。可以安全地使计算机无人看管。
Ctrl+Alt+Del: Logs you out of the current session.
Ctrl + Alt + Del :使您退出当前会话。
通用键盘快捷键 (Common Application Keyboard Shortcuts)
Many applications follow certain conventions with keyboard shortcuts. These should work in most modern applications.
许多应用程序使用键盘快捷键遵循某些约定。 这些应该可以在大多数现代应用程序中工作。
Ctrl+Q or Ctrl+W or Alt+F4: Close application.
Ctrl + Q或Ctrl + W或Alt + F4 :关闭应用程序。
Ctrl+P: Open the Print dialog.
Ctrl + P :打开“打印”对话框。
Ctrl+S: Save the current file.
Ctrl + S :保存当前文件。
Shift+Ctrl+S: Open the File Save dialog.
Shift + Ctrl + S :打开“文件保存”对话框。
Ctrl+O: Open the Open File dialog.
Ctrl + O :打开“打开文件”对话框。
如何创建自定义键盘快捷键 (How to Create Custom Keyboard Shortcuts)
You can create your own keyboard shortcuts and attach them to some action you wish to have carried out when that keyboard shortcut is used.
您可以创建自己的键盘快捷键,并将它们附加到使用该键盘快捷键时希望执行的某些操作。
To create your own keyboard shortcut, open the “System Menu” and click on the “Settings” icon:
要创建自己的键盘快捷方式,请打开“系统菜单”,然后单击“设置”图标:
In the “Settings” dialog, click on the “Devices” menu entry. This is near the bottom of the sidebar.
在“设置”对话框中,单击“设备”菜单项。 这是在侧边栏的底部附近。
Click on the “Keyboard” menu entry.
单击“键盘”菜单项。
Scroll down through the list of existing keyboard shortcuts, and click the “+” button at the bottom of the list.
向下滚动现有的键盘快捷键列表,然后单击列表底部的“ +”按钮。
In the “Add Custom Shortcut” dialog, give your new shortcut a descriptive name in the “Name” field.
在“添加自定义快捷方式”对话框中,在“名称”字段中为新的快捷方式指定一个描述性名称。
In the “Command” field, provide the command that you wish to have executed when your shortcut is used.
在“命令”字段中,提供使用快捷方式时希望执行的命令。
In this example, we’re going to launch Nautilus. We need to type the command that will launch Nautilus, which is “nautilus
“.
在此示例中,我们将启动Nautilus。 我们需要输入将启动Nautilus的命令,即“ nautilus
”。
When you have filled in the “Name” and “Command” fields, click the “Set Shortcut” button. When you see the “Enter the New Shortcut” prompt, press the keys you wish to use for the shortcut.
填写“名称”和“命令”字段后,单击“设置快捷方式”按钮。 当您看到“输入新快捷方式”提示时,请按一下您希望用于快捷方式的键。
In our example, we will press Super+E.
在我们的示例中,我们将按Super + E。
When all fields are completed, click the green “Add” button. This will save your shortcut and add it to the list of existing shortcuts.
完成所有字段后,单击绿色的“添加”按钮。 这将保存您的快捷方式并将其添加到现有快捷方式列表中。
If you scroll down through the list of existing shortcuts you’ll see a new section titled “Custom Shortcuts”. Your new shortcut will be listed in that section.
如果您在现有快捷方式列表中向下滚动,则会看到一个名为“自定义快捷方式”的新部分。 您的新快捷方式将在该部分列出。
And now, pressing Super+E will launch Nautilus. Close the window, and test out your shortcut! It’ll become second nature in no time.
现在,按Super + E将启动Nautilus。 关闭窗口,然后测试您的快捷方式! 它将立即成为第二天性。
While you’re in the Keyboard Shortcuts window, be sure to look through the list and change shortcuts as you see fit! If your keyboard doesn’t have media keys, for example, you can assign one of the F-keys to volume up and volume down.
在“键盘快捷键”窗口中时,请务必浏览列表并根据需要更改快捷键! 例如,如果您的键盘没有媒体键,则可以将F键之一分配给调高音量和调低音量。
Custom shortcuts aren’t just for opening your favorite programs quickly. You can write a short script to automate some common task and bind that script to a keystroke! The possibilities are endless.
自定义快捷键不仅用于快速打开您喜欢的程序。 您可以编写一个简短的脚本来自动执行一些常见任务,并将该脚本绑定到按键! 可能性是无止境。
使用快捷方式 (Using Your Shortcuts)
Keyboard shortcuts can leave you in a quandary. When you start using them, they slow you down! Because they are unfamiliar and they take a moment to look up, they can feel like an impediment more than an accelerator.
键盘快捷键可能会让您陷入困境。 当您开始使用它们时,它们会使您减速! 因为它们不熟悉,并且花了一些时间来查找,所以它们比加速器更像障碍。
Don’t be disheartened, persevere. There’s no instant gratification here. But once you have them locked into your muscle memory, you’re up and running.
不要灰心,坚持下去。 这里没有即时的满足感。 但是,一旦将它们锁定在您的肌肉记忆中,就可以启动并运行。
Pick a handful and start to use those. When they become second nature, add a few more. Then repeat. You’ll wonder how you ever managed without them. It’s like learning the Linux terminal.
选择一些并开始使用它们。 当它们成为第二天性时,再添加一些。 然后重复。 您会想知道如果没有它们,您将如何管理。 这就像学习Linux终端。
翻译自: https://www.howtogeek.com/howto/41418/how-to-be-more-productive-in-ubuntu-using-keyboard-shortcuts/
ubuntu 键盘快捷键