->Title Page
->Intro
->Unix
-->Overview
-->File Structure
-->Online Manual
-->Basic Commands
-->Additional Commands
-->Login files
-->Special characters
--->Wildcards
--->Redirection
--->Pipes
--->Quote characters
->Others
-->Miscellaneous Tips
-->Things to try
->Vi editor
->Mirror sites
->Further reading

[ Up ]
[Prev][Home][Next]
[Author]

Unix ---> Other special characters

If you have set the history history) option, you can use special characters to repeat previously entered commands without retyping them. Here are some of them:1


    !!          On a line by itself will repeat the
                most recent event.
    !com        Will repeat the most recent event
                that begins with "com".
    !?string    Will repeat the most recent event
                that contained "string".
    !-n         Will repeat the nth previous event.
    !n          Will repeat the nth event.  Type
                "history" to see the events numbered.
    ^old^new^   Will substitute "new" for the first
                occurrence of "old" in the most
                recent event, and repeats that event.
    :           Will select specific words from an
                event line so you can repeat parts
                of an event, e.g. 

        !?adam:s/adam/eve/ 

                will substitute "eve" for "adam"
                and repeat the last event with
                "adam" in it.
The semicolon, ";", separates commands. Typing


    clear ; ls
is equivalent to typing each command on a separate command line.

The "&" symbol tells the shell to execute the command in the background. For example, typing xid & would execute XID in the background and give my Unix command line back so I could continue to use it even while XID was running.

The C shell also finds special meaning in the following:


    "  `  {  }  #
Rather than explain the uses of these special characters, I caution you to avoid using them in filenames.

Site Statistics

1 By event I mean one command line. This may be a single command, or it may include a number of commands in a pipeline, or whatever.

Find this site useful? Want to give something back?

t a y l o r@l i n u x a v e.n e t

© 1993-2000 Christopher C. Taylor