Control Characters

University of Wisconsin Madison

Computer Systems Lab CS1000

Wiscinfo
Wiscinfo
CS Home
CS Home
CSL
CSL
Feedback
CS1000
Feedback
Feedback

next up previous contents index
Next: Running Programs Up: Getting By Previous: The Shell

Control Characters

   

As you've likely encountered, computer keyboards rarely have similar layouts beyond the standard `typewriter' set. Control characters provide many functions such as editing, program control, and output control. Occasionally, a keyboard might not include common special keys. If this is the case, you will need to know a few of the following control characters.

To use a control characer, simultaneously hold the CTRL key and press another key. The combination is usually written with the CTRL key being represented as a caret (^ ). You might notice on some keyboards that backspace produces a ^ ? instead of deleting the character to the left. If this happens, you will need to use ^ h to back up a letter. If you'd like to erase the previous word, use ^ w, and to erase the whole line, use ^ u. This last one is useful if you knowingly mistype your password and want to retype it without getting the login incorrect response.

There are a number of other control characters that you can type that perform special functions. For example, if you are caught in an infinite loop, you can kill the running program by typing a ^ c. You can also kill the program using a ^ . This makes the system create a file for you, called core, which is an image of the running program. You may want look at this to do postmortem debugging with the gdb debugger in order to find out what went wrong with the program, but please remove the core file when you are finished because it takes up a lot of disk space.

If a program is spewing output at you and you want it to pause for a moment, but not kill the program, you can use ^s to stop output scrolling and ^q to continue it when you're ready to read further. If you're inputting text to a program, the standard way of indicating the end of the text is with the End of Transmission character ^d. If you have the misfortune of using a keyboard with no escape key, it is essential to remember the ^[ equivalent when using programs such as vi.

control characters
CharacterFunction
^h erase the last letter on this line
^w erase the last word on this line
^u erase the current line
^c kill a running program
^\ kill and dump core
^a suspend output
^q continue output
^[ ESC (equivalent to the escape key)
^d End of Transmission (often EOF)



next up previous contents index
Next: Running Programs Up: Getting By Previous: The Shell



Brent Halsey
Mon Sep 4 23:49:29 CDT 1995