| Jason Spence ( @ 2008-01-03 08:00:00 |
The other day I had to talk to a Force 10 Networks switch, and I typed "
I had to write the server side of a terminal implementation for an embedded system once, and it was a pain in the ass trying to find references for all these control codes I've picked up over the years. It's nice to see them all in one place for a change.
help" at the IOS-like CLI prompt. I got this back:
Special keys:
DEL, BS .... delete previous character
Ctrl-A .... go to beginning of line
Ctrl-E .... go to end of line
Ctrl-F .... go forward one character
Ctrl-B .... go backward one character
Ctrl-D .... delete current character
Ctrl-U, X .. delete to beginning of line
Ctrl-K .... delete to end of line
Ctrl-W .... delete previous word
Ctrl-T .... transpose previous character
Ctrl-P .... go to previous line in history buffer
Ctrl-R .... rewrites or pastes the line
Ctrl-N .... go to next line in history buffer
Ctrl-Y .... print last deleted character
Ctrl-Q .... enables serial flow
Ctrl-S .... disables serial flow
Ctrl-Z .... return to root command prompt
Tab, command-line completion
Exit .... go to next lower command prompt
? .... list choices
Except for the history related stuff, this is a good list of the "standard" control codes that you should expect to be supported by a modern interactive shell. Unfortunately, much of this knowledge is spread over several standards, so most people tend to pick it up by word of mouth when they work in a multiplatform environment. For example, most of the movement commands can be found in the Bash manual, C-s and C-q come from ASCII, C-z comes from Cisco IOS's use of the DOS convention (which in turn is DOS trying to play nice with CP/M), and the DEL and BS mess is familiar to anyone who's used Linux for a while. I had to write the server side of a terminal implementation for an embedded system once, and it was a pain in the ass trying to find references for all these control codes I've picked up over the years. It's nice to see them all in one place for a change.