Handling control characters on the command line

From RoggeWiki
Jump to navigation Jump to search


printf

printf '\033'"\n" | cat -vet -
printf '\x0d'"\n" | cat -vet -
printf '[ctrl-v][ctrl-m]' | cat -vet -; echo

Control-V

Use Control-V to insert control codes. This works for the shell and vi.

[ctrl-v][esc]
[ctrl-v][ctrl-m]