(011) Advanced keyboard tips for Linux

Source: Internet
Author: User

Fundamentals of the ten-year OPS series-Linux

Zeng Lin

Contact: [Email protected]

Website: www.jplatformx.com

Copyright: Please do not reprint the article without permission

First, Introduction

The advanced keyboard technique referred to here actually has an attribute that is specifically targeted at the Bash command line. Bash uses a library called ReadLine (a collection of threads for different applications to share) to implement command-line editing. For example, move the cursor through the arrow keys. In addition, Bash has a number of other features that can be used as additional tools for work.

One thing to note here is that some of the following key combinations (especially those using the ALT key) may be recognized by the GUI as other functions. When using the Virtual Console, all key combinations should work correctly.

Second, the cursor movement

The following table defines some combination shortcuts that are used to move the cursor.

Key combinations Role
CTRL + A Move cursor to beginning of line
Ctrl+e Move cursor to end of line
Ctrl+f The cursor moves forward one character, and the right ARROW key acts like
Ctrl+b The cursor moves backwards by one character, and the left ARROW key acts the same
Alt+f The cursor moves forward one word
Alt+b Move the cursor backward one word
Ctrl+l Clear Screen

Third, modify the text

The following table defines the keyboard directives that are used to edit command-line characters.

Key combinations Role
Ctrl+d Delete the character at the cursor
Ctrl+t Swap the character at the cursor and the character in front of it with the position
Alt+t Swap the word at the cursor and the word in front of it with the position
Alt+l Converts a character from the cursor to the end of a word to a lowercase letter
Alt+u Converts a character from the cursor to the end of a word to uppercase

Iv. cutting and pasting text

The ReadLine document uses terms killing and yanking to refer to what is commonly said as cut and paste. The following table lists the commands used to cut and paste. The clipped content is stored in a buffer called kill-ring.

Key combinations Role
Ctrl+k Cut text from cursor to end of line
Ctrl+u Cut text from the cursor to the beginning of the line
Alt+d Cuts the text from the cursor to the current ending
Alt+backspace Cuts the text from the cursor to the prefix. If the cursor is at the beginning of a word, the previous word is clipped
Ctrl+y Paste the text in the kill-ring buffer to the cursor position

(011) Advanced keyboard tips for Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.