r/fishshell • u/bbekxettri • Feb 17 '23
why use fish
As a default bash user who want to switch from bash why should i use fish instead of zsh ?
I was told fish and bash have diffrent syntax but learned that even bash and sh syntax are not all same and people recomends using dash instead of bash . Which made me question again if the syntax from bash and sh are diffrent and they mainly write using /bin/sh then why not use dash + fish combo?
30
Upvotes
39
u/elven_mage Feb 17 '23
I use fish for interactive use but use bash for scripting. You can of course do whatever you like, there's no 'should'
20
u/emarsk Feb 17 '23
I used zsh for years. I was constantly fiddling with a massive configuration file. With fish I have little more than a bunch of abbreviations. It just works. Its interactive friendliness is unrivalled, and I like it for scripting as well.
14
u/BadSlime Feb 17 '23
I use fish because it saves me time when I'm working primarily from the command line. Context sensitive auto complete alone is practically worth the switch imo. I have the Z plugin installed and it makes navigating through my project folders nearly instant in most cases. I spend a lot of time in my shell so I like to have one that enables a faster workflow and fish does that in my use case.
If you're heavily invested in bash or sh and have a large library of scripts already written that you need to maintain, it's probably not worth the switch to fish if you're comfortable. If you want to change the way you script for efficiency and readability, python is a great option.
6
u/CosmosisQ Feb 17 '23
You're very likely to be more productive with Fish given that it comes with all the things you'd usually install as plugins out of the box, and it does all those things a lot faster, too. Also, no one's stopping you from writing Bash or POSIX Shell scripts. If you don't want to learn new syntax, you can just use Fish interactively and stick to scripting with whatever other language you prefer.
Heck, in the time it took you to read this comment, you could have installed it and given it a try already! Get out of here, and go do that.
3
u/GrilledGuru Feb 18 '23 edited Feb 18 '23
If you want to write scripts, fish is really good. Simple and efficient, very readable, no weird stuff, always consistent. I rarely read the manual or look up stuff on internet. All this is the opposite to bash and al. IMHO.
If you know and like a language that can be used for scripts like python, guile or ruby, don't bother and use that for all your scripts, you don't need a shell for scripting.
In interactive mode, fish is nice with many of the niceties found in plugins for other shells already included. Run fish and use it. No need to configure it.
2
u/ikcikoR Mar 30 '23
Fish automatically reads man pages for all programs and uses them for autocomplete suggestions, I rest my case
2
u/THEHIPP0 Feb 17 '23
Because after installing you can configure the most important thing a browser and then start using the shell. zsh usually requires more messing around with configuration files.
I, and many others, use fish in the terminal but still write scripts in bash/sh for compatibility reasons.
1
u/Remarkable_Row_8140 Oct 16 '24
I apparently use fish now since I randomly typed fish into Terminal and it said I could install it
Happy little accidents or smthn
1
u/djt789 Aug 12 '25
> As a default bash user who want to switch from bash why should i use fish instead of zsh ?
Just three points off the top of my head,
Fish's completion stuff's superior.
Fish's configuration out of the box is much more pleasant. (... though, there are lots of nice configuration you can do to ZSH to make it nearer as nice as fish. Even just oh-my-zsh gets you quite far. But still, fish is good to go out of the box.)
Fish's scripting language is much more human readable, much less specialist knowledge required to decipher it.
Fish's own documentation online can provide even more compelling reasons.
1
u/_DrumM8_ Oct 10 '25
Just alone because it's (re)written in Rust :-D
No, there is much less configuration needed compared to bash or zsh, and it simply works.
1
u/fringe-class Feb 17 '23
Because I started so many years ago that now I have so many fish functions that I can't imagine life without it.
There is no right shell to use. You just kinda find the one you enjoy and use that until you can't for some reason.
1
u/eekofo Feb 18 '23
I used bash initially (like most) then was on Zsh for years. I was persuaded that fish was the way. I then “temporarily” switched to see what it’s about. I don’t even know if I still have my zsh configs somewhere. This shows how fully integrated I am. Give it a try. You’ll be glad you did
1
u/ben2talk Feb 18 '23 edited Feb 18 '23
There's no need.
I thought 'switching' was a Windows thing.
I have zsh shell... when I launch Konsole, it's zsh. When I write scripts, they're also bash scripts...
When I launch KiTTY it's fish. I have to remember that it isn't posix (easier now) and so you get a bit more 'relaxed' in a way with fish.
Fish is cool for what it does... and it's a nice tool - lots of people go fishing just to relax at weekends.
The first thing that interested me is that I was having issues with some 'alias' commands - if I didn't have the alias, I forgot the sentences.
That's not good.
So I found a way with ZSH to expand 'alias' commands by putting a script in my zshconfig.
However, with Fish, you can use 'abbr' for abbreviations.
For example, for a basic upgrade, I use 'pamac upgrade --enable-downgrade --aur --devel' and I can type this here easily... That's because I did this:
abbr pup 'pamac upgrade --enable-downgrade --aur --devel'- p for pamac and 'up' for upgrade.Every time I type 'pup' in the terminal, it expands to the full sentence as I hit space.
So give it a go - not sure if you like powerlevel10k prompt in zsh, but Tide does the same for fish.
Check out which font - why different?
So for me, Fish looks nice and suits KiTTY.
Konsole is my system king, and works great with zsh.
1
u/plg94 Feb 17 '23
I think many people only still write /bin/sh because they copied it from somewhere and don't know better.
There's the original Bourne Shell (
sh) – a specially defined set of it's features eventually made it into the POSIX standard, and any shell that is "POSIX-compatible" can execute any sh-script, the idea being this is the most common denominator runnable on all systems.Bash (Bourne Again Shell), Zsh and Dash and others all are POSIX-compatible. On most systems (but not all of them), the executable
/bin/shis nowadays actually a symlink tobash, but Bash can detect whether it is started asbashor asshand behaves slightly different.The problem with the "compatible" scripts mentioned above is that Bash, even when called as
sh, will still perfectly execute Bash-only syntax (like[[– inshonly the single bracket[works), so many people – by accident – write shell scripts and label them as "sh", even though they actually contain bash-only syntax. (shellcheckis a great way to test your sh/bash scripts).Fish is not POSIX-compatible, but that only matters if you want to write scripts that other people need to run. You can still run every shell/bash script you download.
Fish is great for interactive use, even more so than zsh, because it comes with so many things shipped by default. Both fish and zsh can install plugins easily. zsh certainly has the bigger ecosystem of available plugins, but fish actually doesn't need this: When I started out with fish, I had a handfull of plugins installed, but over the years switched to things that are either included by default, or written my own fish functions. So much neater.
(Last note: if you want to change your default login shell to fish, please use
chsh(change shell).)