5 ms·
Mastering Bash and Terminal (2017)
- dang 5y agoDiscussed at the time: Mastering Bash and Terminal - https://news.ycombinator.com/item?id=13400350 https://news.ycombinator.com/item?id=13400350 - Jan 2017 (180 comments)
- GloriousKoji 5y agoI know zsh has all the new fancy stuff but keeping the bash shell as default for macOS would have made my life just a little bit easier.
- e40 5y agoThankfully you can change it. First thing I do when setting up a new mac: install Homebrew and change my shell to the bash that comes in Homebrew.
- klysm 5y agoSurprised not to see a mention of “!!” here, I use that a decent amount
- Zababa 5y agoI use "sudo !!" all the time, it's really useful.
- blockloop 5y agoThat's one I forgot to mention but I do use it a lot. I don't know if you know this but you can also do a substitution on the previous command. I often do something like `ssh root@proxmox01` and then `!!:s/1/2` which runs it again, but substitutes 1 for 2 and executes `ssh root@proxmox02`. edit: I realize that example fails the speed test vs `ctrl+p, backspace, 2, enter`, but hopefully you can see the value.
- sceadu 5y agocould that just be shortened down to ^1^2?
- PeterWhittaker 5y agoAbout two years ago, a change in work caused me to become a heavy git user. One of the most important changes I made to my bash setup was to change my prompt to multi line, detect whether I was in a git repo, include the branch in the prompt, and also include a summary of git status. Very handy! (The check also makes sure I am in the repo part of the repo, and not, say, in its .git folder or other non-working folders.)
- agustif 5y agoIf you want all this and some more without setting it up yourself, oh-my-zsh spaceship prompt theme is great... I don't feel at home at a terminal without it by now, so one of my first installs after brew ;-) https://github.com/spaceship-prompt/spaceship-prompt https://github.com/spaceship-prompt/spaceship-prompt
- heavyset_go 5y ago> One of the most important changes I made to my bash setup was to change my prompt to multi line, detect whether I was in a git repo, include the branch in the prompt, and also include a summary of git status. Check out starship[1] if you haven't already. It's a prompt that does just this and more, and works across shells like Bash, fish, zsh, etc. [1] https://github.com/starship/starship https://github.com/starship/starship
- PeterWhittaker 5y agoThanks! I will definitely check that out!
- noahtallen 5y agoMy favorite for this purpose is pure prompt: https://github.com/sindresorhus/pure https://github.com/sindresorhus/pure I wasn’t sure about multi line at first, but really digging it now.
- blockloop 5y agoI'm glad to see this has aged well and still provides value. I plan to write V2 sometime in the near future.