this post was submitted on 04 Jul 2023
1254 points (98.6% liked)

linuxmemes

20756 readers
239 users here now

I use Arch btw


Sister communities:

Community rules

  1. Follow the site-wide rules and code of conduct
  2. Be civil
  3. Post Linux-related content
  4. No recent reposts

Please report posts and comments that break these rules!

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 50 points 1 year ago (5 children)

Ctrl+R

Then type any part of the command (filename, search string, etc)

Ctrl+R again to cycle through the matches.

(Best feature in bash)

[–] [email protected] 12 points 1 year ago (1 children)

Use fzf for a more visual search.

[–] LeanFemurs 5 points 1 year ago

This is the way.

[–] [email protected] 8 points 1 year ago (1 children)

I've been using this for a long time, never knew I could press Ctrl + R again. Thanks!

[–] wandering_nomad 8 points 1 year ago

Ctrl + S to go the other way if you overshoot!

[–] [email protected] 6 points 1 year ago (1 children)
[–] [email protected] 3 points 1 year ago (1 children)

Can't just hit enter to run the one you want then, though.

[–] rufus 7 points 1 year ago

Type: !1234 ... to run whatever history number of the command.

[–] [email protected] 1 points 1 year ago (1 children)

But how to go backwards and forwards through the results? I just cycle through again!!

[–] [email protected] 1 points 1 year ago
[–] LucidDaemon 1 points 1 year ago

Wish I knew this sooner.