next up previous
Next: Command Aliases (alias) Up: USING UNIX Previous: Killing Jobs and Processes

Repeating and Changing Commands (!, ^)

You can repeat the command you just gave using !! The command !number and !text repeat the command labeled by number on your history list and the last command that stated with text, respectively. Thus, for example, !23 repeats the command labeled 23 on the list reported by history. The command, !r repeats the last command that started with an ``r'', for example a runtex command.

There is a way to make substitutions in previous commands using the ^ operator. If you had typed mw file1 file2 you will get a message that mw is unknown. What you really wanted was mv. If you then type ^w^v it will take the w from your last command and change it to a v and thus execute mv file1 file2