this post was submitted on 11 Aug 2023
47 points (94.3% liked)

Linux

48332 readers
500 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

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.

top 50 comments
sorted by: hot top controversial new old
[–] [email protected] 29 points 1 year ago (2 children)

I use fish because I have better things to do than tweak my shell configuration and debug shell plugins.

When I tried oh-my-zsh and prezto (I think?) they came with tons of plugins that performed badly and made it hard to get things done (specifically, they ran git status synchronously on every new prompt, which does not work well in a moderately large repo). Fish had similar features but wasn't horribly slow, so I use it.

[–] techwizrd 8 points 1 year ago

Same. I've written a fish plugin, but other than that I just fish pretty much stock. It works and just gets out of my way.

[–] [email protected] 4 points 1 year ago

I'm also using fish shell, it find it very user friendly and extremely practical. It gathers all the programs options which you can see when pressing Tab and together with the fzf plugin for history and file search it becomes a very smart shell to use.

[–] [email protected] 24 points 1 year ago (2 children)

When you’re working on a remote server you’re probably not going to have fish available.

[–] [email protected] 17 points 1 year ago

You're probably not gonna have zsh either, though, but I wouldn't recommend using sh as your shell on your personal dev machine 🤷‍♂️

[–] [email protected] 5 points 1 year ago

That's actually a pretty good reason. Currently I own my work environments but that won't always be the case, I'm sure.

[–] [email protected] 19 points 1 year ago (1 children)

I use Fish shell and while it is pretty nice on its own, the fact that it is non-standard does cause problems. Many times you will search for something online and you'll find nice bash results, which either you will have to execute directly in bash or modify to work correctly in Fish.

I don't think all of Fish's design choices are the best, either. But for an OOTB experience, it is nicer than either Bash or Zsh.

[–] [email protected] 14 points 1 year ago* (last edited 1 year ago)

Let the religious shell wars begin ... again

Only right answer is of course TCSH. Not much documentation and support, ancient but still receives new bugs in 2021 (on Debian), but attackers hate it! (I love it)

My real suggestion is to learn zsh and fish (and bash). Try using them for all your purposes and in the end you will automatically find the one (or more of them) that suits you best and that you like most for your daily tasks.

[–] [email protected] 14 points 1 year ago* (last edited 1 year ago)

I like zsh with oh-my-zsh and Powerlevel10k. This gives me a clear indication of which system I am on and remains POSIX-compliant.

The biggest deal breaker for me for shells like fish are the they are not POSIX-compliant and I need to use remote systems regularly. Doesn't make sense to use something with a different syntax to me.

[–] [email protected] 12 points 1 year ago (1 children)

I moved to the fish shell a while ago and I love it, everything I need works OOB. I don't understand people complaining about the different sintax for scripts, this is a non issue, just use #!/bin/bash at the start of your script and it will use bash, or just execute directly with "bash script.sh".

[–] [email protected] 3 points 1 year ago (2 children)

I don't understand people complaining about the different sintax for scripts, this is a non issue...

I have a two major reasons:

  • Adding another shell syntax adds unnecessary cognitive load and context switching. If I were to use a non-POSIX shell, I'd have to remember another, highly domain-specific language, in addition to BASH/ZSH/SH and need to context switch when writing and debugging shell scripts. Instead, I can spend the mental energy on writing code, and learning new languages and tools.
  • Most remote *nix systems run BASH or another POSIX-compliant shell. This introduces additional context switching when administering or debugging remotely.
load more comments (2 replies)
[–] sf1tzp 9 points 1 year ago* (last edited 1 year ago) (1 children)

If you want you can install starship, which provides a lot of the nifty prompt customization I see in other people's zsh configs. I've been using it with bash for a few months now and like it a lot.

[–] [email protected] 3 points 1 year ago (1 children)

I use tide with fish and I personally prefer it over starship.

[–] [email protected] 2 points 1 year ago (5 children)

Thanks for pointing me at tide. I always used the pure prompt but tide looks like pure on steroids.

load more comments (5 replies)
[–] [email protected] 9 points 1 year ago

If you’re looking for a nicer shell for personal use, fish is pretty nice

If you want to run arbitrary scripts and deal with setup scripts from coworkers etc, you’ll want to fall back to zsh/bash regularly, though

If you’re fine with understanding when your shell is the problem, fish is nice for interactive use

[–] [email protected] 8 points 1 year ago (7 children)

I use Linux for work and I'm pretty much fully in bash. What's the benefit of changing to a different shell? Will all my scripts still work?

[–] [email protected] 4 points 1 year ago

Power, convenience, customizability

Pretty much the same reasons you use Linux at all

[–] [email protected] 2 points 1 year ago* (last edited 1 year ago)

I made myself this question and jumped to fish and never came back to bash. I now use mostly the terminal for most things together with ranger.

If you decide to jump to fish install fish + fisherman + fzf

Fisherman for installing themes and plugins and with it you install the fzf plugin. I also have the tide theme which is pretty nice.

PS. Bash scripts still run as bash so there is no conflict.

[–] [email protected] 1 points 1 year ago

On Mac, zsh is default.

I use zsh with zinit (with turbo mode) or zgenom.

Zsh quick start kit and z4human (created by powerlevel10k author) are great starts if you do not want to invest on configuring zsh.

load more comments (4 replies)
[–] [email protected] 7 points 1 year ago

I use zsh with a few customisations. I’ve used fish but it’s sometimes slow so I just stick to zsh.

[–] [email protected] 7 points 1 year ago

Still a bash lover after 24 years at the command line. 😄

[–] [email protected] 7 points 1 year ago

Genuinly asking, what is wront/lacking in bash?

[–] [email protected] 6 points 1 year ago (4 children)

ZSH, ZSH, ZSH! Fish is not POSIX compliant, meaning most shell scripts won't work and it has its own special snowflake syntax.

Also, don't use Oh-My-ZSH! Just use the package manager in your system.

[–] [email protected] 5 points 1 year ago (2 children)

you can always run scripts with the shell they were written for (and you can even argue that people writing scripts should always set the shebang)

load more comments (2 replies)
[–] [email protected] 2 points 1 year ago* (last edited 1 year ago)

meaning most shell scripts won't work

What do you even mean? I run my bash script on Fish shell. No problem. Just need indicate the shebang at the top of the shell script.

unless you want to run zsh/bash commands in cli mode - that's a different story.

load more comments (2 replies)
[–] [email protected] 6 points 1 year ago

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.

[–] [email protected] 6 points 1 year ago

bash with ble.sh! I'm a former fish user, and ble.sh replicates all of fish's quality of life improvements (that I used, at least) and then some, all with a single source command in my .bashrc. And it's still bash at the end of the day, so online resources to tweak and modify it all still work.

[–] [email protected] 6 points 1 year ago* (last edited 1 year ago) (1 children)

I tried fish and liked it.

But compatibility to bash is not great.

So I changed to zsh with zsh quick start kit (zgen and later zgenom). Zsh has more more community, frameworks and plugins.

Now I roll my own zsh config using zinit with turbo.

[–] [email protected] 2 points 1 year ago

I use fish with the bass plugin for any time I need to work with bash scripts.

[–] [email protected] 5 points 1 year ago

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.

[–] [email protected] 5 points 1 year ago

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.

[–] [email protected] 4 points 1 year ago

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.

[–] xchino 4 points 1 year ago

Give me fish or give me vanilla bash.

[–] gamma 4 points 1 year ago

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.

[–] [email protected] 3 points 1 year ago (4 children)

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!

load more comments (4 replies)
[–] [email protected] 3 points 1 year ago

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.

[–] [email protected] 3 points 1 year ago

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

[–] [email protected] 3 points 1 year ago

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.

[–] [email protected] 3 points 1 year ago* (last edited 1 year ago)

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.

[–] [email protected] 2 points 1 year ago

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.

[–] [email protected] 2 points 1 year ago

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 🤣

[–] [email protected] 1 points 1 year ago

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

[–] [email protected] 1 points 1 year ago

Are you in a tech support role at work? If so are you supporting Linux boxes, either servers or desktops? If yes then stick with BASH and learn VI - not because it is better, but because it comes with almost every distro (a small number install nano instead). If not, try out all the new stuff and see what suits you.

[–] [email protected] 1 points 1 year ago

Been using fish for awhile. I don’t need much more than smart autocomplete (which is built in) and some small QOL plugins. Sometimes it sucks because the syntax is slightly different than bash or zsh so you will have to get used to that.

load more comments
view more: next ›