Юніксоїди шутят
Jan. 10th, 2017 07:46 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Невинне питання: In the terminal, I can type CTRL-R to search for a matching command previously typed in BASH. E.g., if I type CTRL-R then
Невинна відповідь: If I understand the question correctly you should be able to cycle through alternatives by repeatedly hitting Ctrl+R.
Оригінал публікації — на Дрімі. Підписуйтеся, бо ЖЖ може опинитися закритим у будь-який момент.
grep
is lists my last grep
command, and I can hit enter to use it. This only gives one suggestion though. Is there any way to cycle through other previously typed matching commands?Невинна відповідь: If I understand the question correctly you should be able to cycle through alternatives by repeatedly hitting Ctrl+R.
Ctrl+R grep
Ctrl+R Ctrl+R ...
If you feel the command will be used frequently, you could add a tag
command #useful
Then ctrl+r #useful
This works because #
is a comment delimiter, i.e. everything that comes after the symbol is not interpreted as a command.
However, it will be recorded in the history and is thus searchable.
Оригінал публікації — на Дрімі. Підписуйтеся, бо ЖЖ може опинитися закритим у будь-який момент.