Use the command line editing function provided by shell to select set-o vi or set-o emacs!

Source: Internet
Author: User
Tags delete key

After logging on to the system today and logging on to N commands, I habitually used the upward arrow key to find the historical commands. I suddenly saw this:

$ ^ [[A ^ [[A ^ [

Press the delete key to display the following information:

$ ^ H

You can only use Ctrl + BackSpace to delete the content on the left of the cursor ~~~!!! --B

Then I asked Wells, but I only needed to make a small setting and enable it in the Console:

$ Set-o emasc

I checked the cause on the Internet and referenced a section in "FreeBSD "for the time being:

Bytes -----------------------------------------------------------------------------------------------

  • Use shell
  • In fact, sh and csh are not the best choice for common users, because these two shells are not easy to use, for example, the command line "strongswan" function is not available, and the "strongswan" command cannot be used to re-execute the "strongswan" command. The new shell, such as bash and tcsh, have these convenient functions, but after installing these shell programs, in order to change the shell settings of common users to use these shell programs. You can use pw, vipw, or chsh to change the shell using volume.

    These two shells do not comply with the sh and csh cells. Therefore, users who prefer the csh cell can select the tcsh and those who prefer the sh cell selection bash. In addition to the two types of shells, shell such as ksh and zsh are available for selection. If you have no preference for the two types of shell, you can choose bash. It is a GNU component, which is much larger than the standard sh function.

    After using these two additional shell types, you can use the command line rewrite function provided by Shell to use commands. Depending on zookeeper, you can select either the zookeeper mode of the VI lattice or the Emacs cube mode. The default mode is the Emacs mode, in this way, the direction cursor is used to trace and modify the line-through commands, while the VI lattice uses the letter command as the character delimiter, for example, if we use four mobile optical icons, H, J, K, and l, the advantage of the VI cell is that we do not use the control cell outside of the basic environment, therefore, it can be used for any client configuration, and you do not need to activate the basic operation during the preparation. It is the fastest after the operation is completed. Compared to VI, the Emacs cell is more suitable for migrating from a personal computer to a Unix user. In bash, KSh, and zsh, run the following command to switch between Emacs fuse and vi fuse:

    Bash $ set-O Emacs

    Bash $ set-O vi

    Use different commands in tcsh:

    % Bind Emacs

    % Bind vi

    You can also set a different name for commonly used commands, which can be converted to zookeeper. For example:

    Bash $ alias EC = "echo this is a alias"

    Bash $ EC

    This is a alias

    Another feature used by Shell to facilitate the use of batch operations is the function of auto-dynamic batch full command or file name, because the file name under FreeBSD may be very long, compare all of them. In fact, you can enter part of the name, and then press TAB labels (in the VI layout, Press ESC commands twice). Shell will automatically upload the remaining part of the full file name. If the imported names cannot determine the specific commands or files, shell will only be able to determine the parts, then, Zookeeper notifies the user to upload a specific file.

    In fact, even under the Basic Sh or CSH, special characters such as "*" can be used to combine the delimiter with the pattern matching.

    Bash $ CD/usr/loca *

    Bash $ pwd

    /Usr/local

    In Unix, multiple programs have the processing capability of synchronous pattern matching, while shell pattern matching is the most commonly used. Shell can use these special modes to configure multiple files for the ultimate operation purpose. To be familiar with Unix, you must master mode matching.

    When the hacker attempts to write a keyword in bash, in addition to the need to set the hacker's terminal's performance to accept 8 characters (the stty pass8 command line is used ), you also need to set bash scripts to export scripts. you can log on to these scripts. the profile file includes the following settings:

    Bind 'set convert-meta off'

    Bind 'set meta-flag on'

    Bind 'set output-meta on'

    Related Article

    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.