Keyboard (ctrl) commands in Linux



Keyboard (Ctrl) Commands - when things go wrong


Keyboard or control commands are the command that are used with combination of ctrl + any other key. These commands are also useful when things goes wrong, like system freezes, to interrupt any process, killing any process, the output of programs scrolls continuously etc.  




<Ctrl>a

Moves cursor to beginning of line of text (on the command-line).


<Ctrl>b

Backspace (non destructive one character back).


<Ctrl>c

Terminate a foreground job. Ctrl-C sends the interrupt signal SIGINT. So it stops the current running process and returned to command prompt.


<Ctrl>d

If no process or command is running on the shell prompt, then it Logs out from the current session same as exit

If any process is running or file is open then it send [End-of-File] to the current process. The end-of-file character causes the terminal driver to make available all characters in its input buffer immediately; normally the driver would collect characters until it sees an end-of-line character. If the input buffer is empty (because no characters have been typed since the last end-of-line or end-of-file), a program reading from the terminal reads a count of zero bytes.




<Ctrl>e

Moves cursor to end of line of text (on the command-line).



<Ctrl>f

Moves cursor forward one character position.


<Ctrl>g

This command ring a bell. In an xterm system it might beep.


<Ctrl>h

Erase one character. It is similar to pressing backspace.


<Ctrl>i

Horizontal tab.

<Ctrl>j

Newline (line feed).



<Ctrl>k

Vertical tab. When typing text on the console or in an xterm window, Ctl-K erases from the character under the cursor to end of line.



<Ctrl>l

It clears the terminal screen.


<Ctrl>m

Carriage return.




<Ctrl>n

Erases a line of text recalled from history buffer.



<Ctrl>o

Issues a newline



<Ctrl>p

Paste previous line from history.




<Ctrl>q

It also controls the flow of output to terminal. It resumes the terminal. Try it after <Ctrl>s to resume the terminal.


<Ctrl>r

Backwards search for text in history buffer.


<Ctrl>s

It controls the flow of output to terminal.  <Ctrl>s freezes the terminal.


<Ctrl>t

Reverses the position of the character the cursor is on with the previous character.


<Ctrl>u

Erases the line previous to cursor is pointed.


<Ctrl>v

When inputting text, Ctl-V permits inserting control characters.


<Ctrl>w

Ctrl-W erases from the character under the cursor backwards to the first instance of whitespace.



<Ctrl>x

It Cuts highlighted text and copies to clipboard.



<Ctrl>y

Pastes back text previously erased.



<Ctrl>z

Ctrl-Z sends SIGSTOP signal, it freezes the current running program. To restart it from the same point, you need to send a SIGSTART signal which can be done by using fg command or it can be run as a background process using bg command.



Understanding Linux man pages                                         Home Directory



No comments: