abbadon420@sh.itjust.works to Ask Lemmy@lemmy.world · 4 days agoLinux question: I like to browse using ls. Than when I find what I'm looking for, I would like to directly move there with cd without having to retype the path. Is there an elegant solution for that?message-squaremessage-square62linkfedilinkarrow-up1128arrow-down11file-text
arrow-up1127arrow-down1message-squareLinux question: I like to browse using ls. Than when I find what I'm looking for, I would like to directly move there with cd without having to retype the path. Is there an elegant solution for that?abbadon420@sh.itjust.works to Ask Lemmy@lemmy.world · 4 days agomessage-square62linkfedilinkfile-text
Maybe there is a tool that does that? Maybe I’m doing this all wrong and there is a different way I should browse?
minus-squarevalar@lemmy.calinkfedilinkarrow-up108arrow-down1·edit-24 days agoTo add, !$ gets replaced with the last word from the previous command line !! Repeats the most recent command !-N Repeats the Nth previous command !string Repeats the most recent command that began with ‘string’
minus-squarevillage604@adultswim.fanlinkfedilinkEnglisharrow-up50·4 days agoI just learned more about Linux than I did from my whole IT degree.
minus-square4am@lemmy.ziplinkfedilinkarrow-up19·edit-23 days agoYou learned more about shells than you knew. This stuff works on BSD and some UNIX systems too, you know
minus-squareGreyEyedGhost@piefed.calinkfedilinkEnglisharrow-up4·3 days agoMost POSIX-compliant systems?
minus-squareBlue Label@lemmy.worldlinkfedilinkEnglisharrow-up1·2 days agoI learned Ubuntu in uni decades ago, and I didn’t know those commands exist.
minus-square4am@lemmy.ziplinkfedilinkarrow-up25·3 days agoIf !$ isn’t pronounced “ba-ching!” I’m quitting Linux
minus-square🌞 Alexander Daychilde 🌞@lemmy.worldlinkfedilinkEnglisharrow-up11·3 days agoBetter than “bang-ching” which sounds racist to me. lol
minus-squareSkaveRat@discuss.tchncs.delinkfedilinkarrow-up8·3 days agoGreat, now omarchy is going to adopt it
minus-squareMinnesotaGoddam@lemmy.worldlinkfedilinkEnglisharrow-up4·edit-23 days agothe (ng) is silent when used in compound punctuation in ba(ng)
minus-square🌞 Alexander Daychilde 🌞@lemmy.worldlinkfedilinkEnglisharrow-up5·3 days agookay, but now THAT sounds racist for whole OTHER reasons… ;-)
minus-squareMinnesotaGoddam@lemmy.worldlinkfedilinkEnglisharrow-up3·3 days agoit probably is, that professor who taught me it was belgian
minus-squarem-p{3}@lemmy.calinkfedilinkarrow-up35·4 days ago!! is the goat when you needed to run the last command using sudo
minus-squareHal@piefed.nzlinkfedilinkEnglisharrow-up10·3 days agoHot damn, and here’s me thinking thefuck was the way to do this.
minus-squareExec@pawb.sociallinkfedilinkarrow-up22·4 days ago!!:n where n is the nth word after the command in your last line cp file1 file2 nano !!:2 Here nano opens file2.
minus-squareKristell@herbicide.fallcounty.omg.lollinkfedilinkarrow-up15·3 days ago… How have I used Linux for two decades and not run into this once. Amazing stuff
minus-squareGreyEyedGhost@piefed.calinkfedilinkEnglisharrow-up9·3 days agoI’ve never come across this before, and I am completely unsurprised it exists.
minus-squareccunning@lemmy.worldlinkfedilinkarrow-up3arrow-down1·4 days agoHuh - TIL about !-N Thanks 🙏
To add,
!$ gets replaced with the last word from the previous command line
!! Repeats the most recent command
!-N Repeats the Nth previous command
!string Repeats the most recent command that began with ‘string’
I just learned more about Linux than I did from my whole IT degree.
You learned more about shells than you knew. This stuff works on BSD and some UNIX systems too, you know
Most POSIX-compliant systems?
I learned Ubuntu in uni decades ago, and I didn’t know those commands exist.
If
!$isn’t pronounced “ba-ching!” I’m quitting LinuxBetter than “bang-ching” which sounds racist to me. lol
Great, now omarchy is going to adopt it
the (ng) is silent when used in compound punctuation in ba(ng)
okay, but now THAT sounds racist for whole OTHER reasons… ;-)
it probably is, that professor who taught me it was belgian
!!is the goat when you needed to run the last command usingsudoHot damn, and here’s me thinking thefuck was the way to do this.
💯
!!:nwhere n is the nth word after the command in your last linecp file1 file2 nano !!:2Here nano opens file2.
Love it
… How have I used Linux for two decades and not run into this once. Amazing stuff
I’ve never come across this before, and I am completely unsurprised it exists.
I’m loving this
Huh - TIL about !-N
Thanks 🙏