Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

ctrl-o doesn't seem to do anything for me.

ctrl-r, find a command, press ctrl-o -> inserts ^o in the command and exits of ctrl-r.

Running bash 4.4.12(1) on Linux.



sort by: page size:

Doesn't work on GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18)

ctrl+shift+r works though.


Ctrl-X + E doesn't appear to be doing anything in bash.

Ctrl-R in bash?

In bash, I press ctrl-r and then enter part of the command. additional ctrl-r's cycle.

ctrl-r in bash.

Ctrl-W works in bash too.

Note that this enables you to use the bash 'forward search', CTRL+R's forgotten twin.

I use CTRL+R and CTRL+S often in emacs and was frustrated that CTRL+S would not work on a command line terminal. As the article mentions, CTRL+S is typically interpreted as XON. Turning that off will enable forward search.


ctrl-r works great if you have a standard command with a long file path you can't remember.

Just an anecdote though.


Ctrl-O is incredibly useful. Go back to an earlier command, press Ctrl-O repeatedly, and you re-run a series of commands. That doesn't work if some of them were deleted as duplicates.

MacOS and every other Unix.Ctrl-N,Ctrl-P, Ctrl-I... these don't just work in emacs.

That doesn't seem to work, either. Besides, Command generally maps to Ctrl/Alt on most pieces of software.

I was able to use ctrl-j in bash (on ubuntu over ssh) and ctrl-j didn't trigger an execution.

I just did something simple like:

  cat ./test.txt && # hit ctrl-j here
  > less ./test.txt # the ">" was generated by bash automatically
So, it probably depends on what you're doing ...

Ctrl+D is great, but will still run a command if it's been typed out so I always Ctrl+C and then Ctrl+D.

Please report bugs your find on github, or I will lose track of them. There is no ctrl-ins, shift-ins, if you want those shortcuts you can add them in the config. What does ctrl-arrow do in bash? IIRC you have to map it to something it does not do anything by default. For kitty the codes to map are ^[OC and ^[OD

Or ctrl + a in some cases (unixy thing, works in linux terminals as well)

Alternatives would be:

- Cmd+? or Cmd+ (edit supposed to be a right arrow character here, but it seems HN comment strips it)

- Or the linux shortcuts Ctrl+A and Ctrl+E


Or, if you're not stuck on Linux, Control-O (or whatever you've set your terminal DISCARD character to).

ctrl-x e

> It's a small key sequence: ctrl-x e . What's this do? It takes the existing command that you currently have on your command line and opens it in your shell's editor


<CTRL>+X <CTRL>+E works in bash as well.
next

Legal | privacy