zsh or fish for an intermediate Linux user?

So I’ve been using Linux now for a while, and am looking to migrate my dev environment to vim and spend more time in the command line. I’m fairly comfortable with bash but by no means an expert. I’ve used zsh with some minor customization but just recently learned about fish. I’d love to hear people’s opinions.

darklamer,

An old sysadm introduced me to zsh 28 years ago now and I’ve used it as my primary shell ever since. It’s tried, tested and most certainly works well.

featherfurl,

I used zsh for ages but switched to fish a few months ago because its navigation features are amazingly smooth and seamless. I generally write scripts in sh or python so navigation is the most important part of the terminal for me. Fish has bash compatibility plugins if you need them, but the main reason I use it is that it’s the nicest feeling shell to use for getting around in a terminal that I’ve found so far.

That counts for a lot.

Shady_Shiroe,

I daily drive Linux mint and love using fish, I do have a custom built NAS but I rarely ssh into it, so I’m not limited by it, but as some mention that if you’re a dev and do a lot of SSH/remote controlling then it might work against you if you form too many habits.

gamma,
@gamma@programming.dev avatar

I learned Fish by helping someone else in a chat. There’s a lot of cool things, and I think it’s an excellent shell. Fish is an excellent choice for a shell.

Zsh is a much more featureful language (with globbing/subscript/PE flags, native floating point arithmetic, the whole man zshmodules), which doesn’t necessarily make it a better shell. But I like those features, and I find it to be a natural choice to write more complex programs which normally would be a code smell for Bash.

The plugin ecosystem for is much larger than Fish’s as well.

Revanee,

Fish, it just works. Customization is super simple and has a really nice webui if you’re into that sort of stuff. Plugins are easy to install with fisher. Out of the box it’s very ergonomic and you don’t have to deal with tons of scripts that may need debugging. Custom shell functions take 2 seconds to set up. Scripts use a shebang to specify the shell they run in, so you shouldn’t have any issues with that. Whenever I absolutely need to run a command with bash, I just switch to it, do what I need to do, and hop back to fish. Highly recommend, haven’t looked back since I started using it a few years ago :)

xchino,

Give me fish or give me vanilla bash.

Max_P,
@Max_P@lemmy.max-p.me avatar

I use a mix of fish and nu depending on what I’m doing. NuShell is great but still pretty buggy, so I use fish as my default and switch to it when I want to use its features.

I still write most of my stuff in bash however since servers I work with typically only have bash, and so are potential coworkers.

But locally I see no point restricting myself to a POSIX compatible shell, especially for interactive shells. The easier and faster it is to use and customize the better. Being able to parse and use JSON and CSV and other things easily and natively right in the shell is a major quality of life improvement!

zitronen,
@zitronen@feddit.de avatar

Why not use Perl or python for scripting tasks? Bash script is terrible imo.

Max_P,
@Max_P@lemmy.max-p.me avatar

I mean, I guess technically Perl could do but it wont earn you any favors from your coworkers.

I do use Python for higher level stuff but I don’t see a point to go Python when you’re just gonna call 20 subprocess anyway to do like apt update apt dist-upgrade apt install wget this untar this rsync this. Especially when you can’t even assume you’re going to have Python to provision the box.

zitronen,
@zitronen@feddit.de avatar

That’s why I included Perl, it is always there. Just don’t code as if you were in the nineties and Perl is a perfectly legitimate language, even more so for shell tasks. Bad and good doesn’t depend so much on the language but the coder.

Max_P,
@Max_P@lemmy.max-p.me avatar

Bad and good doesn’t depend so much on the language but the coder.

IMO there’s also a component where a good coder will pick the best suited language for the task, but will also pick something that the rest of their (potentially less skilled, junior or even intern) team won’t be scared away by.

If you’re mostly just running a few commands and writing to a bunch of files, bash is great and does that in almost no code and remains quite readable. Like, a backup script for a database is essentially a bash one-liner. I’m sure it’s also easy in a Perl script, but just seeing a .pl file can scare some admins whereas they know what to expect if they see a .sh.

Then there’s also a component of, what does the company uses. If the company runs Ruby apps, then I’d write tooling in Ruby. If the company runs PHP apps, some of the tooling will be written in PHP.

It’s very circumstantial in the end. I’ll definitely whip up some Perl if it’s advantageous, but really most of the time it’s just wrapping an rsync or whatever, and at work it’s usually just some glue or bootstrapping something like Puppet or Ansible. Not a fan of those personally but it’s a safe bet for my role and industry.

On the personal side, I tend to turn to what’s my favorite language at the moment, so lately I’ve been practicing my Rust.

donio,

All of those are good choices with different trade-offs. I am a long time zsh user but I’d say stick with bash until you feel strongly enough about your preferences to evaluate the other options for yourself.

Starbuck,

I’d like to agree with most of the people here and say that while I have a great local zsh setup, 95% of the time I’m working on some other system in the cloud that only exists for a few days at a time and will only ever have bash and basic vim-enhanced, so I never really get to use my oh-my-zsh setup.

throwawayish,

So, initially I stuck to bash and tried to get improved functionality through ble.sh etc. However, for reasons unknown to me, it always seemed to be a buggy mess that was prone to break. Eventually I switched after breaking one last time, where I only had installed ble.sh on a fresh/stock bash; which was the primary contributor that made bash bearable. So if I couldn’t use ble.sh, I had no reason to stick to it.

When faced with the choice of where to go next, I quickly dismissed fish for not being POSIX-compliant. Furthermore, as bash is standard on Linux, so too is zsh standard on macOS. And that enables it to have legs beyond fish. However I also kept fish in mind as somewhat of a last resort if all else failed.

So I began venturing into zsh and was obviously overwhelmed by the myriad of plugins and plugin-managers. People generally go out and somehow stick to ohmyzsh, however it was clearly poorly managed and couldn’t quite deal with the feature-creep in an elegant way.

Many plugin-managers have come out over the years as alternatives that promised to resolve those issues. However, while some of them succeeded initially, they weren’t able to keep that up throughout their lifespan.

When I almost lost hope and had started to gravitate towards learning how I should manage my plugins on my own without any plugin-managers I stumbled upon ZSH Quickstart Kit. Which is a project that’s clearly well-maintained and offered must-have functionality like automatically updating the the plugin-manager, plugins and more while still trying to maintain a high standard of reliability, performance, customization and minimalism. So obviously I had been sold on it and the rest has been history.

Ultimately it’s for you to decide whichever one of the two suits you best. But if you gave zsh a try and wasn’t quite sold on ohmyzsh or any of the other plugin-managers out there, then perhaps consider ZSH Quickstart Kit.

filister,

Depending on your use case. I personally use zsh and oh-my-zsh but you can always customize bash to be more like zsh, have auto completion, etc.

LinuxSBC,

Fish is really good without any configuration, but it’s not POSIX-compatible. Zsh can get very good as well, and it works with most shell scripts, but it requires some setup. I started with fish then moved to zsh.

RiikkaTheIcePrincess,
@RiikkaTheIcePrincess@kbin.social avatar

Whoops, I forgot about this tab and now I'm late to the fish party 😅 I used to use customized zsh but have since switched to fish and it's basically everything I had to work to get zsh to do, only without any of the work. It just is what I want from a shell, I just grab it from the nearest package manager and off I go.

...Unfortunately for fish, that's made me curious that there may be "another fish" out there somewhere that's what I'd be struggling to turn fish into if I knew any better than I do now 🤣

SaintWacko,

I use zsh with prezto plugins which makes it behave exactly like fish, except it works with batch scripts. It’s perfect

shotgun_crab,

Both are good (and Bash too). Try them all and choose the best one depending on the context. For example, on my main PC I use fish with a few plugins (and fisher as the manager), but I’d never use it on a server due to it not being POSIX compliant.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • uselessserver093
  • Food
  • [email protected]
  • aaaaaaacccccccce
  • test
  • CafeMeta
  • testmag
  • MUD
  • RhythmGameZone
  • RSS
  • dabs
  • oklahoma
  • Socialism
  • KbinCafe
  • TheResearchGuardian
  • Ask_kbincafe
  • SuperSentai
  • feritale
  • KamenRider
  • All magazines