In-depth discussion on LINUX Bash command line editing

Source: Internet
Author: User

Before giving you a detailed introduction to LINUX Bash, let us know how to edit the command line, and then introduce LINUX Bash in detail, hoping to be useful to you. In LINUX Bash, you can edit the command line so that you can modify the command you typed before executing the command you typed.

Edit command line

In LINUX Bash, you can edit the command line so that you can modify the command you typed before executing the command you typed. If a spelling error occurs when you type a command, you only need to use the edit command to correct the editing error before running the command, and then run it without re-entering the entire command line. This function is particularly useful for commands that use a long path file name as a parameter.

Table 10-2 is a summary of the command line editing operation. Table 10-2 command line editing

LINUX Bash command line editing

Function
Ctrl + B or the left arrow to move one character to the previous one)
Ctrl + f or right arrow to move one character to the next one)
Ctrl + a move to the beginning of the line
Ctrl + e move to the end of the row
Esc B shifts one word to the left.
Esc f shifts one word to the right.
Del: Delete the character at the cursor
Ctrl + d Delete the character at the cursor
BACKSPACE or Ctrl + h Delete the character on the left of the cursor
Ctrl + k Delete to end of line

Command history

In LINUX Bash, The history command can save the recently executed command. The history number of these commands starts from 1, and only a limited number of commands can be saved, up to 500, that is, the default history Number of the history command is 500. To view the most recently executed commands, just type the history command and enter the Enter key. The recently executed commands are displayed in sequence with the number before each command as the history number ).
$ History
1 cp mydata today
2 vi mydata
3 mv mydata reports
4 cd reports
5 ls

All these LINUX Bash commands are called event). An event indicates that an operation has occurred, that is, a command has been executed. These events are identified by numbers in the order they are executed. This identifier is called a historical event number. The event number of the last historical event is the maximum. Each event can be determined by its historical event number, initial character of the command, or string.

  1. Why does Microsoft envy Linux system security?
  2. Parsing Linux OS modification time
  3. Comprehensive parsing of Linux Make rules
  4. Required Linux shutdown/restart command
  5. Allows you to use the Linux operating system to accelerate remote logon.

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.