Bash vs ZSH vs Fish: What's the Difference?

  Рет қаралды 182,149

Eric Murphy

Eric Murphy

Күн бұрын

Пікірлер: 284
@snuggie12
@snuggie12 Жыл бұрын
Appreciate keeping it objective. I was actually looking for "what to know if you're switching from bash to zsh" and every video that popped up was a sales pitch or dunking on bash.
@Jeff_Seely
@Jeff_Seely Жыл бұрын
Eric, this is one of the most complete explanations on the subject, that I've ever seen. You didn't assume that the viewer knew a darn thing about programming and configuring and you concisely cover it so that anyone could understand. Great job!!!
@Nevermore101
@Nevermore101 2 жыл бұрын
Very well laid out - thanks! Especially liked the parts about the posix compliance as it really helps me make up my mind about what shell to use going forwards.
@Psoewish
@Psoewish Жыл бұрын
I just use fish as my interactive shell because of how comfortable it is to work with, and then use bash for anything else, including scripting. This seems to be a very common setup and it works really well.
@kaitlyn__L
@kaitlyn__L Жыл бұрын
Yep, I use fish for all my day to day but all except my simplest scripts specify bash. There’s just many more resources for more complex scripts in bash, so why bother translating them into fish if you can just invoke bash in the first line?
@BosonCollider
@BosonCollider 11 ай бұрын
I take this slightly further and generally use dash instead of bash for scripts. Dash is literally made to be run as the system shell to run scripts even when the interactive shell is bash, and encourages you to write portable posix-compliant scripts. By contrast, fish is kind of suboptimal as a scripting language since fish scripts are not very portable, and tend to be slightly slower than just writing python or perl which are going to be installed on more systems than fish. But it is really nice as an interactive shell. I've tried shells which are supposed to have more features but ended up missing quality of life features like the amazing fuzzy search when you press tab while typing out a file path in fish
@m.jamilrahman4971
@m.jamilrahman4971 9 ай бұрын
I use fish + starship, yeah i'm lazy 🤣
@typingcat
@typingcat 4 ай бұрын
It's not like every system is BASH by default. OpenWrt and Alpine Linux seems to use ASH. So, in either way, I need to use more than 3.
@dogbyte7875
@dogbyte7875 2 жыл бұрын
Nice! Thanks Mr. Murphy, for your time and efforts to make this video.
@pavelperina7629
@pavelperina7629 Жыл бұрын
It's funny that even thou scripts usually start with #!/bin/sh, they may not work with bourne shell (default on BSD) or dash (which is supposed to be smaller and faster), because they wrongly assume that /bin/sh is symlink to bash. And bash is POSIX compatible (it can run sh scripts), but it also adds some simplified, extended syntax, which is not.
@theawesomesandbox
@theawesomesandbox Жыл бұрын
Ok, so here's a comment for the great info from the channel. I tried out Fish from using a basic terminal and I: - like the features included and not having to do the config myself from scratch (wow, autocomplete is kinda nice), - hate the fact it's not POSIX compliant (sorry, I like using code from the internet for basic tasks without having to do the conversions, since most of the stuff you'll find won't be for fish specifically). ZSH 4 humans then, probs.
@EricMurphyxyz
@EricMurphyxyz Жыл бұрын
That's basically the exact same experience I had using Fish, haha
@kaitlyn__L
@kaitlyn__L Жыл бұрын
The autocomplete and history search is what sold me on fish, but I do most of the scripts in bash for the second reason. Works fine! Now if you’re doing custom bash scripting/programming straight into the command line for one time use rather than running a script repeatedly, I certainly wouldn’t want to switch back and forth all the time.
@rtothec1234
@rtothec1234 Жыл бұрын
If you only got time to learn one shell the learn bash. You’ll find it pretty much everywhere.
@angeldude101
@angeldude101 8 ай бұрын
Fish understands that the traits that make for a good interactive shell are completely different from the traits that make a good programming language (or scripting language). It's right in the acronym: *Friendly Interactive* SHell. Unlike bash which tries to be both a good scripting language _and_ a good interactive shell, fish focuses entirely on being a great interactive shell, and its scripting capabilities and really just for configuring said shell rather than anything else.
@atarg2239
@atarg2239 2 жыл бұрын
Thanks for video. I'd been searching that difference between them recently. 😄
@EricMurphyxyz
@EricMurphyxyz 2 жыл бұрын
Glad it helped!
@SpaceEndeavour
@SpaceEndeavour 2 жыл бұрын
My login shell is dash and my interactive shell is fish. I find that dash works well with all the stuff my system needs to do and fish works well with me.
@pavelperina7629
@pavelperina7629 Жыл бұрын
What's the difference between login and interactive shell?
@ВладКороль-м2л
@ВладКороль-м2л 3 ай бұрын
It's worth noting fish doesn't exist to be a replacement for Bash scripting but t it was designed aa the usee shell. Look at what it offere interactively like out-of-box autocompletion or sophisticated search history, and how it sacrifices on POSIX compatibility. One more advantage of fish is that it's not inherently tied to Linux or Unix and works the same way regardless OS, which I think is an advantage.
@okashiromi5541
@okashiromi5541 9 ай бұрын
Personally I like zsh because I kinda feel like it's the best of both worlds if you're willing to set it up. It also help if you need to work with bash since you need to learn way less differences. I also don't like having two shells bc I feel like it kinda a waste of disk space. But that's a personal opinion and tbh the fish\bash combo might actually be more beginner friendly now that I think about it
@QmiStudying
@QmiStudying 3 ай бұрын
i just use zsh, oh my zsh makes it very easy to add plugins to your configuration. I can't imagine my life without them.
@PerJohanHalsli
@PerJohanHalsli Жыл бұрын
Zsh FTW ;) srsly tho - great video explaining the diferences without any bias towards or against any of them - I've been on Zsh for over a decade now and started out with oh-my-zsh as many do to get all the goodies at once - but it became kinda bloated - so I learned to set up my own config and never been happier - I've tried using fish several times but it's so frekin confusing - think I'm just too comfortable with what I'm using ;) Anyhow - well presented video
@Nikolai508
@Nikolai508 2 жыл бұрын
Personally I use zsh in my terminal, but if I write any scripts it'll be bash. Not sure if this is a stupid reason if the same results can be achieved with a bash shell, but I use zsh because I get features like tab auto completion that allows me to cycle through several results and select the one I want, git status info when entering a git controlled directory and so on.
@zeechy
@zeechy Жыл бұрын
Plus the z makes it sound cool
@kmemz
@kmemz Жыл бұрын
Correct me if I'm wrong, but I think, in fish, if you add #!/bin/bash to the config, everything after that line may run with bash/POSIX syntax. I haven't actually tried it, I don't use fish, but if you're tinkering it's worth a shot to see if it works. Also, don't quote me on this, but I don't think zsh is fully POSIX, but they don't break very far away from it so most POSIX stuff should still work. If something doesn't work in zsh, I think there's a specific call you can make to put it in a POSIX compliant mode, though I forget what. The second part might also just be me misremembering a fish feature as a zsh feature, it's been a hot minute since I found my comfort zone between the three shells so the details are blurring together. As a last note on my comment, I toyed around with editing my PS1/Prompt line in ZSH when I was figuring out my setup, I came up with this line and have come to really like it, whomever reads this, feel free to steal it for yourself and drop it in your own .zshrc PROMPT='%F{green}[%F{red}%2~%F{green}]%F{white} 🠶%F{reset_color} ' That line comes out looking like "[~] 🠶", of course with some fancy colors. And for almost fully fish-like integration, you can download the appropriate plugins to match this plugins line plugins=(zsh-autosuggestions zsh-history-substring-search zsh-syntax-highlighting) That's pretty much everything I do for my own zsh, outside of some aliases and exports.
@mx338
@mx338 4 ай бұрын
I like the fish had, throwing away the baggage of posix, to a create more friendly shell and scripting language, but they didn't overcome the portability problem. I instead write most scripts as a single file python script, since a Python 3 interpreter is present in almost every modern Linux system.
@johnterpack3940
@johnterpack3940 Жыл бұрын
Honestly, ease of modification isn't even a factor in my decision. I don't tend to modify things on the fly. Installing something to get bash tweaked is no more a hassle than installing a plug-in for zsh. I'm more interested in the things that might make a difference in daily operations.
@EricMurphyxyz
@EricMurphyxyz Жыл бұрын
I mean, in my experience, installing a plugin for zsh IS easier than tweaking bash. However there's not a huge difference between the two besides some small things (like zsh has better tab completion). Feel free to use either one.
@emil.steiner
@emil.steiner Жыл бұрын
since fish makes some scripts break i use bash as my default shell, but i invoke fish at the end of my .bashrc if it detects that it is in interactive mode
@shimadabr
@shimadabr 4 ай бұрын
One good thing AI brought us is the ability to easily translate a fish script to bash (and vice-versa). For simple scripts it will do a good job.
@Atif1702
@Atif1702 2 жыл бұрын
Your content is amazing, Eric. Please make a video on different state management libraries (Context API, Redux, MobX, Recoil etc...) and which one is better suited in which scenario? Thanks
@ubercorey
@ubercorey 2 жыл бұрын
Really great for this noob wondering how to get set up to start Dev study. Thank you!
@Phoenix-zk2oe
@Phoenix-zk2oe Жыл бұрын
what do you think about powershell? is worth to learn over bash/zsh ?
Ай бұрын
Where is the "zsh for humans" video that is mentined? KZbin is not finding it...
@MannyGraal
@MannyGraal 2 жыл бұрын
I didn't even know about the variable stuff. Lol I was just using my terminal for updating, CDing into folders and normal things. Also writing neofetch to the end of .bashrc for the neofetch command on start up. Wow, Interesting
@EricMurphyxyz
@EricMurphyxyz 2 жыл бұрын
Yeah, if you don't really do any bash scripting, then fish is probably fine. But just something to keep in mind
@aronwomack359
@aronwomack359 2 жыл бұрын
you can add aliases as well at the end, you can do a lot of things just with nano . bashrc, but appending is better, and I always keep a copy of the config file on an external drive, or a cloud, but that's basically the same idea. I keep a libre office document with all the things like bash, zsh, e.t.c. It has came in handy once or twice. Bash is a very powerful thing if you know how to use it, but I have been using fish, and it has a lot of functions too, but it isn't as fast as the others. Alacrity is the fastest terminal emulator I've used, but I still stick with gnome, but have terminator and others that I use. Bash just has so much info, and support groups, anyone can script If they can copy and paste lol. You can run math problems easier in fish too, they're all basically the same, just different for whatever hardware and etc. they just interpret their commands into machine code, just have different functions. But, as always, you can edit bash to do anything you can imagine, just gotta know a little Code. And patience, lot of that.
@johnnyrosenberg9522
@johnnyrosenberg9522 4 ай бұрын
I was more curious about the difference in scripting, like which one is fastest, some useful features and so on, but I guess there's some video about that too, somewhere.
@Doc_playzz
@Doc_playzz 2 жыл бұрын
Yesssss, thats what i was looking for. hanks for helping
@AGSfeel666
@AGSfeel666 Жыл бұрын
Can I actually use this on a MAC and so changing the behaviour and output?
@EricMurphyxyz
@EricMurphyxyz Жыл бұрын
On MacOS? Of course. But MacOS uses zsh by default.
@PeiDeur-w9z
@PeiDeur-w9z 3 күн бұрын
Kayley Plain
@justrajdeep
@justrajdeep 2 жыл бұрын
I could not find your zshrc can you please share it?
@alexnone
@alexnone Жыл бұрын
Thank you very much i seen this video just in time!
@lazarusrize
@lazarusrize Жыл бұрын
Informative video. Thanks!
@Arsche
@Arsche Жыл бұрын
たしか、ZSHって、MacOS標準のだよね。僕はバッシュが好きだ。FF12のバッシュに憧れるから
@kaitlyn__L
@kaitlyn__L Жыл бұрын
It’s interesting that bash is transliterated into kana but zsh isn’t. It makes sense, bash is pronounced as a word while zsh is pronounced like initials.
@KelleyHaley-y7z
@KelleyHaley-y7z 5 күн бұрын
Boyer Glens
@vikingthedude
@vikingthedude 11 ай бұрын
So the shell is a TUI that runs CLIs and TUIs inside it?
@LynwoodSandlan-f1h
@LynwoodSandlan-f1h 9 күн бұрын
Roberts Prairie
@zeio-nara
@zeio-nara 11 ай бұрын
Lol fish developers just went and reinvented the wheel. It would be understandable if their approach was more convenient than that in bash it would make sense, but it is less convenient - instead of typing just equals sign you must use the whole command
@FredLockamy-w9f
@FredLockamy-w9f 18 күн бұрын
Keebler Plain
@ChozoSR388
@ChozoSR388 10 ай бұрын
Is there a way to implement some of BASH's little conveniences, like echo ${var[^^|,,|~~]} into ZSH, instead of having to resort to echo "$var" | tr ['[a-z]' '[A-Z]'|'[A-Z]' '[a-z]'|'[A-Za-z]' '[a-zA-Z]'] every time I want to change case?
@AmosZangger-u9h
@AmosZangger-u9h 4 күн бұрын
Rippin Highway
@RobertBrown-i8s
@RobertBrown-i8s 9 күн бұрын
Hayley Forges
@starpawsy
@starpawsy 2 ай бұрын
And none of them measure up to the Korn shell. AT&T forever !!! LOL.
@YankaZabka
@YankaZabka 2 жыл бұрын
Thanks for this useful video!
@prashlovessamosa
@prashlovessamosa Жыл бұрын
Hell yeah that's what I was looking for.
@YERAFirearms
@YERAFirearms Жыл бұрын
Arr there a fish2bash and bash2fish conversion scripts?
@HaggaiDominic-p5j
@HaggaiDominic-p5j 9 күн бұрын
Mitchell Flats
@LucilleRoss-k2v
@LucilleRoss-k2v 15 күн бұрын
Gutmann Crescent
@JanetShepherd-h1p
@JanetShepherd-h1p 5 күн бұрын
Lopez Thomas Garcia Jose Young Eric
@BrendaRita-s9q
@BrendaRita-s9q 16 күн бұрын
Leannon Inlet
@AMathMonkey
@AMathMonkey Жыл бұрын
I actually like fish as a scripting language. I think the POSIX standard is odd and makes it easy to write bugs (like if you don't know when to quote variables, or when a process will run in a subshell) and fish fixes these issues by doing saner things by default and removing confusing features (like word-splitting and subshells). I'd love to see fish pre-installed alongside bash in the future so that fish scripts can be considered more portable than they currently are. But something like `sudo apt install fish` is easy to run in the meantime. I can't be the only one who can't stand typing `"${arr[@]}"` to get all elements of an array, and the "fi" and "esac" and "done" keywords which all do the same thing but have to be used in different contexts. Might as well have added "rof" and "elihw" to be consistent. The standard is just messy and irksome.
@zobayer1
@zobayer1 Жыл бұрын
one main problem with this is that you often cannot sudo.
@BarbaraLum-q1r
@BarbaraLum-q1r 3 күн бұрын
Cecelia Route
@ArchibaldJeremy-z8c
@ArchibaldJeremy-z8c 4 күн бұрын
Schoen Centers
@LouiseTony-e2i
@LouiseTony-e2i 2 күн бұрын
Gwen Brook
@manaswinipanda6695
@manaswinipanda6695 9 күн бұрын
Kirstin Ferry
@KellyUnderwood-v2k
@KellyUnderwood-v2k 26 күн бұрын
Blake Centers
@MotleyCronin-b6x
@MotleyCronin-b6x 16 күн бұрын
Ondricka Wells
@GingeraWilson-j5c
@GingeraWilson-j5c 11 күн бұрын
Monahan Ridges
@MatthewMiller-z8g
@MatthewMiller-z8g 12 күн бұрын
Terry Harbor
@DenyseDuba-w8u
@DenyseDuba-w8u 5 күн бұрын
Kaley Prairie
@jnankin
@jnankin 2 жыл бұрын
great video, but also.... drinking game: every time "right here" is said
@JasonBarrera-p5i
@JasonBarrera-p5i 12 күн бұрын
Gonzalez Laura Johnson Paul Harris Mark
@WillisNapenas-i2g
@WillisNapenas-i2g 13 күн бұрын
Deborah Mountains
@jullien191
@jullien191 4 ай бұрын
Muy bien amigo. Estoy con bash
@DaltonShirley-u4o
@DaltonShirley-u4o 2 күн бұрын
Beatty Mountains
@NortonAlvin-t5g
@NortonAlvin-t5g 24 күн бұрын
Miller Track
@BilâlOkur-b9f
@BilâlOkur-b9f 16 күн бұрын
Gottlieb Roads
@RamanPrimo-p3x
@RamanPrimo-p3x 17 күн бұрын
Theron Garden
@rumblef1sh
@rumblef1sh 2 жыл бұрын
I've only just found your channel and am, like others, really enjoying your interesting and well presented content. But (and meant as a kind criticism intended to be helpful) do you think you could perhaps try to avoid saying everything two or three times? You have a tendency to explain something, and then explain it again using slightly different words. I think we got it the first time :)
@asdil12
@asdil12 Жыл бұрын
Anyone knows what terminal font that is?
@MiltonRegan-w8t
@MiltonRegan-w8t 20 күн бұрын
Breitenberg Ramp
@GailJones-j3g
@GailJones-j3g 15 күн бұрын
Rupert Squares
@NoONE-bk7ud
@NoONE-bk7ud Ай бұрын
fish has everything i need
@JustinGreek-b4g
@JustinGreek-b4g 11 күн бұрын
Wilson Anthony Gonzalez Barbara Davis Edward
@ColcloughBoyle-s5j
@ColcloughBoyle-s5j 11 күн бұрын
Corbin Lock
@oitan
@oitan 4 ай бұрын
now i get it. thanks
@0xtz_
@0xtz_ 2 жыл бұрын
Kali Linux have zsh as a default shell 🐧
@EricMurphyxyz
@EricMurphyxyz 2 жыл бұрын
ZSH as a default shell is pretty good, I have no issues with it
@0xtz_
@0xtz_ 2 жыл бұрын
@@EricMurphyxyz yes try to add OhMyZsh to it 👌
@TomAurelio-u3z
@TomAurelio-u3z 23 күн бұрын
Jakubowski Shoals
@TyuAsd-g3l
@TyuAsd-g3l 20 күн бұрын
Halvorson Manor
@ZephaniahJacob-x7u
@ZephaniahJacob-x7u 8 күн бұрын
Ed Light
@CopperfieldOsborn-g9k
@CopperfieldOsborn-g9k 23 күн бұрын
Stark Valleys
@EtrgHgte-l8x
@EtrgHgte-l8x 15 күн бұрын
Huels Crossing
@HoracioBaucom-l9z
@HoracioBaucom-l9z 7 күн бұрын
Napoleon Rest
@BlancheWinters-f3n
@BlancheWinters-f3n 22 күн бұрын
Morar Valleys
@GuyNelson-s1n
@GuyNelson-s1n 25 күн бұрын
Gunnar Mills
@MarcieAlberthal-k4w
@MarcieAlberthal-k4w 8 күн бұрын
Conrad Cape
@BobEdmund-s4f
@BobEdmund-s4f 3 күн бұрын
Jewell Corner
@RohitSormasf
@RohitSormasf 23 күн бұрын
Walker Thomas Thomas Anthony Perez Kimberly
@kaitlynbootman1717
@kaitlynbootman1717 15 күн бұрын
Brown Melissa Moore Scott Hernandez Jason
@bbffna-t7n
@bbffna-t7n 12 күн бұрын
Shields Plaza
@LenaBruno-m6g
@LenaBruno-m6g 13 күн бұрын
Welch Oval
@bridgettegregory
@bridgettegregory 6 күн бұрын
Thompson Thomas Hall Larry Taylor Patricia
@MelissaLucky-d1t
@MelissaLucky-d1t 22 күн бұрын
Hunter Vista
@douglasemsantos
@douglasemsantos 5 ай бұрын
Great video!
@Miguel_GM
@Miguel_GM 2 жыл бұрын
Thanks.
@LincolnIsaac-v9v
@LincolnIsaac-v9v 10 күн бұрын
Bashirian Isle
@JonathanLionel-e8t
@JonathanLionel-e8t 7 күн бұрын
Schultz Inlet
@lynnessjeffree3206
@lynnessjeffree3206 11 күн бұрын
Brown Matthew Allen Patricia Taylor Melissa
@fatcat3513
@fatcat3513 11 күн бұрын
Play settings : speed 1.75x problem solved🎉
@OliverNelly-m1p
@OliverNelly-m1p 23 күн бұрын
Conn Canyon
Why I Switched Back to Bash, And Why You Should Too
10:42
The Linux Cast
Рет қаралды 41 М.
Terminal vs. Bash vs. Command line vs. Prompt
11:06
Luke Smith
Рет қаралды 237 М.
Остановили аттракцион из-за дочки!
00:42
Victoria Portfolio
Рет қаралды 3,6 МЛН
Поветкин заставил себя уважать!
01:00
МИНУС БАЛЛ
Рет қаралды 6 МЛН
Please Help This Poor Boy 🙏
00:40
Alan Chikin Chow
Рет қаралды 11 МЛН
100+ Linux Things you Need to Know
12:23
Fireship
Рет қаралды 1,1 МЛН
Fish Shell Tips and Tricks (Can Your Shell Do This?)
14:44
DistroTube
Рет қаралды 66 М.
How Google's Chromium Took Over the Browser World
9:59
Eric Murphy
Рет қаралды 318 М.
Why More People Dont Use Linux
18:51
ThePrimeTime
Рет қаралды 233 М.
How ThinkPads Became The Internet's Favorite Laptop
10:01
Eric Murphy
Рет қаралды 1,1 МЛН
Become a shell wizard in ~12 mins
12:25
CODE IS EVERYTHING
Рет қаралды 250 М.
Can You REALLY Trust Proton Mail?
16:57
Eric Murphy
Рет қаралды 211 М.
The Top 5 ZSH Plugins I CAN'T Live Without!
9:53
Eric Murphy
Рет қаралды 52 М.
Fish Is A Modern Shell For The Sophisticated User
15:56
DistroTube
Рет қаралды 213 М.
Остановили аттракцион из-за дочки!
00:42
Victoria Portfolio
Рет қаралды 3,6 МЛН