Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I 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?



off 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.


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 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.


> 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 :)


Also, 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.


That'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.


tab completion is a default feature of GNU BASH


it 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-f...


Well, 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...


  cd s*/l*/f*/p*




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: