5 ms·
A link on HN about improving bash and it wasn't instructions on how to install zsh. I'm pleasantly surprised :)
by oneandoneis2 12y ago
A link on HN about improving bash and it wasn't instructions on how to install zsh. I'm pleasantly surprised :)
- weaksauce 12y agoI like bash and all, but a well tuned zsh is amazing. I was hesitant for a while but it really improved my workflow in the shell.
- oneandoneis2 12y agoI switched from bash to zsh some times ago, and miss it when it's not there.. but TBH, the only real difference for me is zsh can turn 'cd s/l/f/p[tab]' into 'cd some/long/file/path' - all other features I'm aware of either exist in Bash too, or aren't useful for me. What are some of the differences that made such a difference for you?
- foxhill 12y agooff the top of my head: - tab completion on a shit-ton of stuff (configure scripts, makefiles, ssh hosts, aptitude packages, git branches) - partially entered command? push up to look at similar commands you have previously entered - immediate propagation of zsh_history to all open shells you could (correctly) argue that you can do all that in bash. of course, shell scripting is turing complete, so yes, you can. but with zsh, it's already there, and ready.
- valarauca1 12y agotab completion is a default feature of GNU BASH
- weaksauce 12y agoit tab completes more than bash does. switches, parameters, servers defined in your .ssh/config file etc. it's really impressive. coupled with the jump/mark script[1] it's amazing. mark . marks the current directory in a folder full of symlinks. jump <tab> expands to a list of your favorite folders. super simple and extremely low overhead. [1] http://jeroenjanssens.com/2013/08/16/quickly-navigate-your-filesystem-from-the-command-line.html http://jeroenjanssens.com/2013/08/16/quickly-navigate-your-f...
- dllthomas 12y agoWell, bash tab-completes with arbitrary complexity, seeing as it can be set to call functions... I assume the same is true of zsh, so the real question has to be adjusted for particular setup. There are a number of interesting questions of that form. Off the top of my head: The minimal setup I get from simplest packages in distro X at time Y. The maximal setup I can extract from distro X at time Y. The typical install I am likely to sit down at if it is not my own. The setup I am likely to evolve to after working with the system for it for time T...
- __david__ 12y agoBash has wonderful completion, all the stuff you listed. It's in the "bash-completion" package, and usually just an "apt-get install bash-completion" away. I use bash's reverse incremental search ("C-r") to do that. Is the zsh that much better than that? The history sounds neat, except that I tend to segregate my terminal tabs to specific tasks/projects so I'm not very likely to want a command from one tab in another. Also I always set my bash history file to /dev/null so I don't have to worry about leaving sensitive data lying around, which means I new tabs are always a clean slate.
- foxhill 12y ago> Bash has wonderful completion, all the stuff you listed. It's in the "bash-completion" package, and usually just an "apt-get install bash-completion" away. i don't doubt that at all - but it's hardly default bash, and i frequently don't have root on the systems i use (whereas zsh is usually there) > I use bash's reverse incremental search ("C-r") to do that. Is the zsh that much better than that? hands down yes. nobody had to explain how "up-complete" (i don't know what's it's called, but i'm calling it that because that's what it does) works to me. simple and intuitive! > Also I always set my bash history file to /dev/null fair enough - different people have different uses for things, i thoroughly recommend you try zsh though, because, why not! have a poke around the excellent oh-my-zsh as well, try out some themes. i thought i had a good work flow with bash, and that there was really any room for improvement. after a few hours of zsh on my laptop, it was my shell everywhere :)
- wtetzner 12y agoAlso, M-q to stash the current command, run another command, and have the first command pasted back to the prompt, with point in the right location.
- Nick_C 12y agoThat's neat, you could almost convert me. For Bash, M-# (alt-shift-3) puts a comment token '#' at the start of the current line and begins a new empty line. Handy if you are 150 characters deep in a command and realise you need to do something else for a moment (i.e. momentarily in the correct sense). You can store your 150 char command and come back to it, it is in the history and can be retrieved with a couple of Up-arrows.
- smorrow 12y agocd s*/l*/f*/p*
- TylerE 12y agoYep! And thanks to oh-my-zsh (https://github.com/robbyrussell/oh-my-zsh https://github.com/robbyrussell/oh-my-zsh) it really requires very little fiddling, maybe 10 minutes worth.
- themoonbus 12y agoI'm a recent zsh + oh-my-zsh convert, and I have a severe case of "why didn't I do this before"s. Here is a great gallery of oh-my-zsh themes: http://zshthem.es/all/ http://zshthem.es/all/
- TylerE 12y agoYea, it's pretty awesome. What's really neat is you can even use it on Windows. My personal setup is Cygwin Zsh inside Console2 (tabbed cmd.exe shell) proxied via ansicon.exe (makes cmd.exe ansi color escape aware). It's not quite as nice as say Konsole on linux or iTerm2 on a mac, but it's the best I've found for windows. Setup guide: Setup console2 like this http://www.hanselman.com/blog/Console2ABetterWindowsCommandPrompt.aspx http://www.hanselman.com/blog/Console2ABetterWindowsCommandP... This post sets up ansicon: http://www.kevwebdev.com/blog/in-search-of-a-better-windows-console-using-ansicon-console2-and-git-bash.html http://www.kevwebdev.com/blog/in-search-of-a-better-windows-...
- NateEag 12y agoI'm stuck on Windows at work, and landed on ConEmu as my terminal emulator (running bash, though - I've never made the jump to zsh): https://code.google.com/p/conemu-maximus5/ https://code.google.com/p/conemu-maximus5/ I haven't tried Console2, so I can't provide a comparison, but here's Scott Hanselman deciding to switch: http://www.hanselman.com/blog/ConEmuTheWindowsTerminalConsolePromptWeveBeenWaitingFor.aspx http://www.hanselman.com/blog/ConEmuTheWindowsTerminalConsol...
- curiousbiped 12y agoSee also antigen(https://github.com/zsh-users/antigen https://github.com/zsh-users/antigen), it works with oh-my-zsh and makes adding extra plugins a lot cleaner.
- sliverstorm 12y agoI keep switching back and forth between the two. The latest versions of bash have recovered a lot of ground, and zsh (in my experience) has a tendency to get really slow. Maybe it's the command completion here, or the history search there, but it just tries to be too sophisticated for my purposes (huge cluster environment with countless executables in my PATH, which by the way is constantly changing)
- stormbrew 12y agoThe thing about a shell (much like an editor, really) is that if you invest in it too far it becomes much more frustrating than reasonable to go without it. If you tend to shell in to a lot of servers that you lack control over, getting used to zsh niceties just makes the rest of your life that much harder. At least in my experience.
- uuid_to_string 12y agoWhat if you invested in learning a shell that was installed on all servers you lack control over? What if you invested in learning POSIX sh? Wouldn't your scripts and one liners written in POSIX sh work in zsh, bash, etc.? You could be comfortable on any server, no matter what the shell. Even servers that default to tcsh still have /bin/sh.
- stormbrew 12y agoI'm not saying don't do that, and I'm comfortable using and scripting for anything from POSIX sh to zsh, can get by in fish, etc, etc. But if you're going to dive deep on any of them, bash has a pretty unique and strong argument for being quite likely to be available on most of the machines you work with on a day to day basis.
- uuid_to_string 12y agoBy "you" do you mean me, personally? The servers I use do not have bash installed by default. The only time I use it is when I am forced to by an installation script. I install bash on an as needed basis, and when I'm done using it, I uninstall it. I just have no need for it otherwise. What is the shell on Android? Is it bash?
- stormbrew 12y agoNo, definitely meant it as a general thing. And really, directed towards people working with servers, and not to people working with embedded devices (like Android) where keeping to POSIX (or specifically ash, which is what android and busybox use) is probably a necessity. Many servers don't have bash installed as part of their base distribution, but if they're going to have another shell already installed it's much more likely to be bash than zsh.