As you saw earlier, previous commands can be reused with the help of the history feature. But the history feature executes commands without any modification. If you want to execute a previous command with some modification, you can use the vi editing features for command editing. If you press the keystroke combination, the last command appears on your command prompt. If you continue pressing , you can go back as far as the history supports. To go to the next command, you can press the key during this process. If you want to edit a particular command, first bring that command on your command prompt using this procedure and then use to move right and to move left. As you can see, all of these are vi commands. You can use other vi commands to insert or delete any text on the command line.
Use of vi commands with the command line editing feature is controlled by the EDITOR environment variable. The value of this variable must be set to vi to use vi commands.
Study BreakPracticing POSIX Shell Capabilities
|
Top |