Set-O vi

Source: Internet
Author: User
Et-o vi
Use the esc + K key to use the previous command.

Esc + k
Esc + j

Ksh is emacs by default. Set-o emacs

[Prompt]: Try more F1--F11, you will have unexpected gains Oh!

Use commands that you have used in AIX

   When used in AIX, the default shell is KSH, which is different from bash in linux, he cannot use the commands we used last time using keys in DOS or other shortcut keys that we are already familiar, for example, in the doscommand status (I listed the shortcut keys that I often use, and I may also add other ones ), you can use F7 to obtain the non-repeated commands that you have entered in the current DOS window (in Windows, sort the non-repeated commands you entered in the current window in sequence, with 0, 1, 2... ),F1 repeats the characters at the same position in the previous time, F3 repeats all the commands at the previous time, F5 and F8 flip up the commands I have already entered, f9 is the ID of the last Non-repeated command that you want to display.(For example, after entering a DOS window, I entered two commands in sequence: dir and cd test. The first command in this window is dir, and so on. When I press F9, the system prompts me to "Enter the command number". At this time, I can enter the command number according to the sequence number entered last time. For example, if 0 is selected, this is the dir command, this function is the same as F7, but F7 can be selected, and F9 can be directly input. These two functions are useful when you enter a long command ).
   To use commands that you used last time in AIX, use the following methods:
   1. Run set-o vi in ksh. The entire command status is VI editor. the operation method is the same as that in VI editor. Repeat the previous command, press ESC in the current status bar and enter k to view the next command. Press k to query the previous command. h can move one character forward in the current row, l it can move one character backward in the current row. Of course, this is equivalent to being in the vi state. All commands for Single Row Operations in the vi state can be used. After editing, press Enter.
   2. If it is not in ksh, you can run ksh-o vi in the Command window. Other commands are the same as the first method.
   3. Set EDITOR = vi in the environment variable of ksh. Add EDITOR = vi and export EDITOR to. profile.
   4. Delete History commands. You can query a. sh_history file in the current user's home directory, which records all the commands you have entered in the current user. You can edit the file and delete the command. Of course, you can put your favorite commands or long commands in it, and then you can directly call them. Of course, from this file, we can see that the previous command is obtained using the vi commands mentioned above. In fact, ksh is used to obtain information in this file.
   5. tips:
    A. Repeat the previous command and enter r in the ksh state.
    B. You can execute r a = B in the ksh state, which means to replace a in the previous command with B and then run it.



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


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 \'

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: 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.