petsoi@discuss.tchncs.de to Linux@lemmy.ml · 4 months agoEffectively Use History Commands in Linuxitsfoss.comexternal-linkmessage-square38fedilinkarrow-up1117arrow-down12
arrow-up1115arrow-down1external-linkEffectively Use History Commands in Linuxitsfoss.competsoi@discuss.tchncs.de to Linux@lemmy.ml · 4 months agomessage-square38fedilink
minus-squaresome_guy@lemmy.sdf.orglinkfedilinkarrow-up6·4 months agoHere’s something I use to search history for commands or keywords. I have this as a function in my profile: function hgr() { history | grep "$1" } history grep Usage: hgr git to search for commands containing git. Someone more knowledgeable may be able to point out ways to improve this.
minus-squareWill@lemmy.mllinkfedilinkEnglisharrow-up4·edit-24 months agoyou can get a lot of the way there with Control+R reverse history search (mentioned in the article) – and it’s interactive. With fzf you can even get fuzzy history searching (the first search result has a video).
Here’s something I use to search history for commands or keywords. I have this as a function in my profile:
function hgr() { history | grep "$1" }
h
istorygr
epUsage:
hgr git
to search for commands containinggit
.Someone more knowledgeable may be able to point out ways to improve this.
you can get a lot of the way there with Control+R reverse history search (mentioned in the article) – and it’s interactive. With
fzf
you can even get fuzzy history searching (the first search result has a video).