14.3 C Shell Features
14.3.5 Command-line substitution with the C shell
You can use command-line editing to make changes to the last command and then execute it.
Command Format:
^old_string^new_string

Each string can be any length. The caret (^) symbols tell history to locate the first occurrence of the letter(s) old_string in the previous command, substitute the letter(s) new_string for it, and execute the modified command. 

The first example in the Figure replaces the z in the previous command with an s

The second example combines history and command-line substitution to recall and change a previous command. The :p is used to view command number 38 first without executing it. Then the d is replaced with an s.

Interactive Media Activity (Flash, 92 kB)
  Command Line Substitution with the C Shell

In this media activity, you are logged in as user2 and your current working directory is: /home/user2. Type the commands that would accomplish the requested objectives. Note: Be sure to press enter after each one. Click on step 1 to begin.