hello, quick question
what is the "ctrl j" keyboard shortcut in bash?
what does it do?
thank you
hello, quick question
what is the "ctrl j" keyboard shortcut in bash?
what does it do?
thank you
@howtobash , there is no 'shortcut' , ^J is a LINE FEED.
Where have you encountered this ?
NB: I've edited this as i'd erroneously said it was a Vertical Tab, thks to @Paul_Pedant for clarification.
On my system, Ctrl-J emits NewLine, Ctrl-I emits TAB, and Ctrl-K emits Vertical Tab.
I'm guessing this may depend on the terminal driver, and MacOS is likely to go its own way.
In general, man ascii shows a two-column format for character codes. For the first 32 rows, the left column shows the control characters, and the right column shows the corresponding normal characters. The Ctrl key just flips a single bit (the 0x40 bit), so that Ctrl-@ generates NUL, Ctrl-A generates SOH, Ctrl-F generates ACK, Ctrl-[ generates ESC, Ctrl-_ generates US, etc.
The Ctrl characters that cause signals and other events can be displayed using stty -a, and many of these are configurable via stty or by specific commands which use the tcsetattr library calls (600+ lines of man page).
Some commands (such as vi and bash, and the Terminal itself) also modify the behaviour of Ctrl characters: for example, Ctrl <minus>, Ctrl <plus> and Ctrl <zero> change my CLI windows font size.