448
submitted 10 months ago by Pantherina@feddit.de to c/linuxmemes@lemmy.world

image of a cat looking at a bunch of paper a woman shows it, with the header "cat ~/.bash_history"

you are viewing a single comment's thread
view the rest of the comments
[-] Rin@lemm.ee 33 points 10 months ago

So, yk how the history command outputs something like this:

1   Abcd
2   Efgh
3   Ijkl

If you run !2, you will run Efgh.

It blew my mind the first time I saw it, but maybe I'm just stupid.

[-] XEAL@lemm.ee 17 points 10 months ago

I actually use quite frequently "sudo !!“, but I didn't know the details of why it worked...

Now I see more sense in using the history command, specially combined with grep.

[-] platypus_plumba@lemmy.world 2 points 10 months ago

Same here, I just assumed it was a special thing that saved the last command. Had no idea it was actually a query to the history

[-] lemann@lemmy.one 5 points 10 months ago
[-] rtxn@lemmy.world 3 points 10 months ago
[-] PipedLinkBot@feddit.rocks 3 points 10 months ago

Here is an alternative Piped link(s):

https://www.piped.video/watch?v=sXx7b0uCWkk

Piped is a privacy-respecting open-source alternative frontend to YouTube.

I'm open-source; check me out at GitHub.

this post was submitted on 19 Nov 2023
448 points (97.9% liked)

linuxmemes

20901 readers
1766 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