BASH - ZSH
Posted by feeblington@reddit | linux | View on Reddit | 44 comments
im a linux newb - im trying the flavours to see what i like: just trying out zsh and the autocomplete is kinda handy! save me typing as much:
to the more experienced with either bash or zsh - share your opinions, id love to learn.
what are benefits of either?
as someone who uses a pc to browse, game and thats about it does it even matter?
this is not asking for support as i am able to use - just more opinions and pros and cons!
i use a 15 yr old hp pavillion running arch
deusmetallum@reddit
If you really like the autocomplete with zsh, you should check out fish, it's even better!
I personally have no preference between bash and zsh because they're both posix compliant, meaning that the syntax is identical. As such, I can switch between the two of them without really noticing that I did so.
Fish, on the other hand, has a much better configuration management, does a lot of what I want out of the box, but the only downside is that it's no posix, so I don't remember the syntax for for loops and stuff (because bash/zsh is embedded deeply in my memory).
Atijohn@reddit
yep, the problem with fish is that using fish locks you into using fish only, meanwhile if you learn zsh, then you've also learned bash and sh, which can be useful whenever you don't have access to zsh
hpxvzhjfgb@reddit
I discovered this recently too. a few months ago I tried switching to nushell because I thought bash is a hideous and terribly designed language that I should replace with something more modern and structured. I didn't think compatibility with bash would be something I would care about at all, but I used it for about a month and it very quickly got annoying not being able to run a lot of stuff, so I uninstalled it and I'm back on bash for now. I'll have to try zsh some time
StingMeleoron@reddit
Do it. Zsh with grml-zsh-config (IIRC) is amazing.
memilanuk@reddit
I've seen the grml stuff mentioned a few places, but I'm still not really clear on what exactly it brings to the table? Could you give a quick elevator-pitch / synopsis?
deusmetallum@reddit
I wouldn't say you're locked into using fish. I will often just run bash from within my shell to do the task I need to complete. I will always use bash for scripts that need to be independent of my personal shell.
Atijohn@reddit
well not hard-locked of course, but confusing fish and bash syntax is why I stopped using it in favor of modded zsh
Junior_Common_9644@reddit
Please remember that Fish is for home systems, not for the professional Linux and UNIX world, for the most part, as in the professional space things are written for the POSIX scripts like ksh, bash, zsh, etc etc.
feeblington@reddit (OP)
why are people reporting this post? are they reading the very first line and reacting? smh
AutoModerator@reddit
This submission has been removed due to receiving too many reports from users. The mods have been notified and will re-approve if this removal was inappropriate, or leave it removed.
This is most likely because:
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
Megame50@reddit
zsh has the best autocompletion of the three major shells imo.
https://www.reddit.com/r/linuxquestions/comments/1s91jlc/what_is_the_state_of_shells_in_2026/odls6v4/
Martialogrand@reddit
<><
Junior_Common_9644@reddit
Generic Christian car bumper sticker isn't a shell, just like Fish isn't a POSIX compliant shell. ;)
razorree@reddit
try oh-my-zsh
with
ZSH_THEME="powerlevel10k/powerlevel10k"and a few basic plugins:
plugins=(autoupdate git zsh-autosuggestions command-not-found zsh-fzf-history-search zsh-syntax-highlighting)Junior_Common_9644@reddit
I also recommend zplug, as it can pick and choose from oh-my-zsh and other zsh add-ons. Like I'm using:
# Zplug plugins
zplug "zplug/zplug"
zplug "zsh-users/zsh-completions"
zplug "zsh-users/zsh-syntax-highlighting"
zplug "zsh-users/zsh-autosuggestions"
zplug "zsh-users/zsh-history-substring-search"
zplug "rimraf/k"
zplug 'plugins/git', from:oh-my-zsh
zplug 'plugins/kubectl', from:oh-my-zsh
zplug 'plugins/terraform', from:oh-my-zsh
zplug 'romkatv/powerlevel10k', as:theme, depth:1
zplug 'lukechilds/zsh-nvm'
zplug 'plugins/asdf', from:oh-my-zsh
jscodin@reddit
Second this, some cool qol plugins that are available too
HeligKo@reddit
Zsh to me seemed neat, but working in Linux/Unix bash is almost universal, so for any scripting that is what I use. There is also very little you can do in zsh that can't be done in bash. It's just not as easy to set up.
TCH69@reddit
Both bash and zsh provides autocomplete, use one you find convenient.
GrandBIRDLizard@reddit
you can keep the familiarity and simplicity of bash by just installing bash-completion and voila auto complete with bash
feeblington@reddit (OP)
I tried this but couldnt seem to get it working which is whyi dabbled in zsh and the autocomplete for thst just seemed to work. Im no biased id rsther stick with the more common one if bash has the autocomplete jargon
GrandBIRDLizard@reddit
My only assumption is you installed or built it and never sourced it. read the wiki for that and the programs gh README has some imortant info
https://github.com/scop/bash-completion
feeblington@reddit (OP)
well i went back to it and figured my mistake - i hadnt added the correct lines to bashrc! ..here is my amended and working bashrc....complete with autocomplete, and history (history being the main thing i want!) your comment made me realise this so big thank you...
feeblington@reddit (OP)
I did.... I vould not work it out....maybe i will in a month when mh understanding has inproved
popcapdogeater@reddit
Zsh is just a fancied up bash where you can waste a lot of time customizing it.
I like to tinker, so I use zsh on my home laptop.
For work (or home projects where I use a raspberry pi) I always stick to bash to keep things simple. I still have customizations but in battle tested bashrc files that I rarely change much anymore.
untamedeuphoria@reddit
For your purposes zsh is likely fine. It has certain limitations due to design decisions in the language that make it incompatible with more complex bash scripts, and as a result it can get you into some bad habits. I would with rather complex bash scripts, and in my opinion you're going to write complex shell scripts, you should learn both bourne shell and bash off by heart and not touch zsh at all unless you're good at separating the syntax in your mind. In particular due to the differences in how indirection and indexed arrays are structured.
Zsh is completely compatible with bourne shell, but not bash. Bash is completely compatible with bourne shell but not zsh. But bash is way more widely used and has conventions closer to other languages and thus is less of a headfuck if you code in it. Zsh is very well optimised for interfacing with. And for that reason I see it as an interfacing shell. But if you are going to actually writing script files with any degree of complexity, don't touch zsh, as you will need to unlearn it, and you cannot test certain script snippets directly in your terminal without switching away from zsh anyway.
feeblington@reddit (OP)
Atm ive got 2 seperate terminals one setup with zsh one with bash so i can learn zsh while still having bash....still unsure which to go with however your made me mean toward bash more
untamedeuphoria@reddit
If you plan to learn to script properly, then use bash as zsh would be a mistake. If you just need it to use a terminal for minor things in a purely interactive way; then zsh is a perfectively suitable choice if you find it easier to learn. It's just the whole unlearning thing is a massive pain in the arse if you find yourself needing to do so later... way more then a pain in the arse then just sticking with baesh.
I am able to keep the different syntaxes of the different shells separate in my head. But I also did spend years working with them professionally and it was a hard road to make that separation in my mind's eye. I would not bet on having the capacity to do this. If you ever need to do things of actualy complexity or subtlety with shell scripting. Then you will likely need to learn bourne shell and bash quite well. But I am also a minority of humans, and most linux user don't need such depth of knowledge. So the question you should first ask yourself it "do I want to learn to write script files?" If yes, bash and bourne. If no, then go with the easiest thing for yourself to get into things now.
rabbit_in_a_bun@reddit
Live inside bash for a year or so before you want to try looking for easier tools. There are also such autocomplete tools for bash, and bash is still the default OOB in servers and such.
fellipec@reddit
zsh is fine.
If you have to use bash for some reason, it is almost the same, you'll be able to use it fine.
aloobhujiyaay@reddit
If you’re on Arch and like tweaking things, you’ll probably enjoy ZSH more long term honestly
syklemil@reddit
At that point I'd just go with fish. The reasons to not use
fishdon't seem to apply to you, and it seems to offer the best interactive experience out of the box.Personally I use
fishinteractively andbashwithset -euo pipefailfor very simple scripts (and Python for not-so-simple scripts; shell scripting very quickly becomes too wibbly-wobbly for my tastes).The reasons for picking bash are usually tied into sysadmin work, shelling into various machines, needing to write scripts that work everywhere (possibly even on machines that have some simpler POSIX sh than bash). They're good reasons, but they don't apply to you.
The reasons for picking zsh is a bit more varied. It offers a bit more for the interactive user than bash, but is generally outdone by fish. It is closer to POSIX sh than fish, but again, you don't seem to have any reason to care about POSIX sh. So there doesn't really seem to be any reason not to go whole hog.
(There's also Apple, which seems to have gone with zsh over bash for licensing reasons, and ship an ancient version of bash for that same licensing reason.)
sp33dykid@reddit
Long time zsh user myself but I've switched to fish about a year ago and haven't gone back to zsh since. Stopped using bash 20 years ago.
AkelGe-1970@reddit
fishis the best shell most probably, but most of the scripts that you find online are written for bash. If at work you write a script forfish, no one will use it, or it is impractical to use it on servers, because you will have to installfishon all of them.So my suggestion is learn how to write scripts in
bash, and usezshon your computer :)jeenajeena@reddit
Using fish as interactive shell, and running scripts with bash/sh is still an option.
vanillaknot@reddit
bash is literally everywhere. zsh is not.
bash is no minimalist shell. It is extremely capable and programmable. Learn it well.
ephemeral_resource@reddit
It can be helpful as you said to reduce typing. It doesn't slow me down at all learning or anything so I don't see any negatives. There are some other renown shells too surprisingly in fish, ksh, etc.
I use zsh with ohmyzsh and powerlevel10k profile and don't add too much else to my .zshrc. A few alias', functions, vars, user-dev tool pathing, and that's about it.
funbike@reddit
For a shell, Zsh. For scripts, Bash or old
sh.Zsh is basically a superset of Bash. You may want to share scripts, so write them in bash so everyone can use them, or sometimes in sh for an even broader audience.
I purposefully have not learned zsh-specific syntax (other than options). I don't want to depend on things that aren't available to me when using Bash, either in scripts on when shelling into a server.
yahbluez@reddit
I use bash with the typical enhancements and python if bash is not good enough. I decades of using linux all small steps into other shells moved me back to bash.
My point is, if something needs more coding than just a bash script i move to python as basic script language.
BigHeadTonyT@reddit
You might enjoy Oh My Bash and Oh My Zsh too. OM Zsh: https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
There are differences but I rarely run into them. Off the top of my head, I can think of sourcing a file, like .bashrc/.zshrc. On Bash, this should work:
. .bashrcOn Zsh:
source .zshrcSo I do:
source <file>on both, works with Bash and Zsh. When do you source these 2 files? When you have changed something in them and don't want to logout/login. Should be the same with /etc/environment.I run Manjaro and Manjaro sets up a mean Zsh config out of the box, love it. Miss it every time I use any other distro. I use SSH a lot, often install Zsh on machines I remote to. But I am too stupid to copy Manjaros config. It is available on Github. This, I think: https://github.com/Chrysostomus/manjaro-zsh-config
Powerlevel10k is old, not seeing updates. But then again, why mess with perfection.
I tried Fish years ago, when it was newish. I did not get along with it, too different from Bash. I like to use Bash-scripts etc. With Zsh, I don't really have to care about differences. Bash is the default all over the place. My VPSs, many distros, some Docker containers etc. It is Bash or Sh (sh seems to be mainly containers).
mina86ng@reddit
I use bash because it’s 99% compatible with POSIX shell¹ which helps when I write shell scripts. It’s been a while since I’ve used zsh, but my conclusion then was that it has more POSIX-incompatibilities (even when configured to be compatible). And based on that metric, things like fish are a no starter.
As others have pointed out, if you like a lot of auto-completion,
bash-completionis a must. (I actually dislike it to be honest).¹ For people curious, the only incompatibility I’m aware of is that in
>$foobash splits$foowhereas POSIX dictates that$foois not split. Quoting of course solves the problem.Jumpy-Dinner-5001@reddit
zsh is more customizable but takes a lot longer to configure.
bash is enough for pretty much all you do.
Personally, I use zsh on my work machine because I have a configuration and custom plugins that I wrote that grew over years (almost a decade).
But I don’t really care that most other systems use bash.
On my private systems I use fish and bash nowadays, I don’t want to bother with zsh anymore and fish provides everything I need on my personal computers.
It’s not bash compatible and scripting or shell expansion doesn’t work the same but whenever I need that, I simply switch to bash.
Angar_var2@reddit
If you are going into sys admin waters, managing multiple servers etc it is better to learn the default functionalities of bash because they are everywhere the same. If not, feel free to use whatever rocks your boat.
vip17@reddit
You can add autocomplete to bash with https://github.com/akinomyoga/ble.sh
Unruly_Evil@reddit
You're already doing the right thing by experimenting; that's how you learn what fits your workflow.
Bash vs Zsh in practice:
For your use case, Honestly? It doesn't matter much. Both will handle everything you're doing without issues. The autocomplete and convenience features of zsh are nice, but you're not going to notice a performance difference or lose functionality either way.
Since you're already enjoying zsh's autocomplete, stick with it! The small quality-of-life improvements add up when you're typing commands daily. If you ever switch to a distro that defaults to bash, you can still install and use zsh personally.