openmic.social is an uncensored community. You may encounter strong language, controversial opinions, and mature or NSFW material. You must be 18+ to browse. Illegal content is prohibited and removed on sight — please report it. By continuing, you accept that you may see content you personally disagree with.
I like the way you think! Too bad a I replied to a seaming empty post some 26 min after you. I always disliked this about Reddit. Seeing someone rewording the top reply for karma.
You mean something like this?
ls /your/long/path/namecd !$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.
!!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.
💯
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
!!: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 🙏
I think, if your using bash
alt + .
Does the same thing as typing
!$
ls /super/long/path/to/dir
cd alt + .
I believe if you hit it again, it cycles through all previous last words
https://ostechnix.com/list-useful-bash-keyboard-shortcuts/
And there goes my daily new knowledge snippet! Thanks!
Holy fucking shit. I’ve dabbled in Linux for so long to not know. Thank you!
I like the way you think! Too bad a I replied to a seaming empty post some 26 min after you. I always disliked this about Reddit. Seeing someone rewording the top reply for karma.
In some shells (e.g. fish), “running” a directory changes to it so you can save keystrokes and just delete the "ls ".