00:00 Intro 01:57 built in functions 02:51 count built in function 03:18 math built in function (BTW you can also scape the * when running multiplication math function: math 2\*3 an it works as expected ) 04:40 random built in function 05:20 prevd and nextd built in functions 06:20 keybindings for prevd and nextd built in functions (tldr; Alt+→ and Alt+← ) 07:32 keybinding for ls built in function (tldr; Alt + l ) 08:21 keybinding for pager (tldr; Alt + p ) 09:57 keybinding for what does that command do? (tldr; Alt + w) 10:58 keybinding to open your $EDITOR (tldr; Alt + e ) 12:10 keybinding for forgetting previous sudo command. You know, sudo make me a sandwich :) (tldr; Alt + s ) 13:00 Epilogue 13:57 Thanks Patreons!! And yes I also love fish since many years ago!! And I miss its features when I login in systems with bash shell... :)
@YannMetalhead2 жыл бұрын
Thank you!
@atlantic_love4 ай бұрын
What I love about this guy is that he is respectful toward technologies that he isn't using or supports, and gets on to the point of his talks.
@keethums2 жыл бұрын
He’s gone Pescatarian I see.
@DistroTube2 жыл бұрын
I think I visited a Pescatarian Church once. Nice people. ;)
@tailsorange28722 жыл бұрын
@@DistroTube be sure to eat Fish and Chips on stream during your monthly streams :) Here's my situation for my Compaq Presario V2000 -> My old CPU has decided to kick the bucket.... And I am in the midst of acquiring a 64 bit cpu for Tresquel Linux. I have the broadcom Wlan/ bluetooth card that has FOSS compatible firmware (openfwwf)....... Can't wait to do a Tresquel/ OpenBox/ Tint2/ feh, etc combi...... for my compaq. (I went from Debian on openbox to Alpine linux on Openbox.... and now that )
@PressThatButton2 жыл бұрын
I love the fish shell since starting to use it a few months ago. I didn’t realize a lot of these tips and tricks. This is awesome.
@valerioboz54102 жыл бұрын
(It has been 6 years since I logged onto KZbin to leave a comment.) Wow. Thank you. Congratulations on your work, congratulations on the CC-BY choice of this video, and I wish you a lot of good things. Finally I'm not POSIX compliant but I'm more happy.
@zenitsu29892 жыл бұрын
I've been using fish since last year, thanks to your videos! fish + starship = beyond best.
@AndiKod Жыл бұрын
I like both for different reasons, yet Fish's math builtin works quite like expr in Bash ;) Fish: math 2 + 2 # 4 Bash: expr 2 + 2 # 4 Bash: expr 2 \* 2 # Just escape the * for multiplication expr just needs space around the operator, 2 + 2 instead of 2+2
@ficolas23 ай бұрын
Expr is a bit too strict with its syntax, its annoying. Also, imo, where math shines, as programmers is that you can do hex math math -b 16 '2 + 10 + 0xF' (the quotes arent needed) With bash, you'd need to use printf to turn the number to hex, and $((0x__)) to use the hex literal printf '%x ' $(expr 2 + 10 + $((0xF))) Thats ugly as shit, and not easy to remember compared to how simple the fish command is
@MasterHigure2 жыл бұрын
If you write the name of a command and alt-up, it will add the arguments of your previous command to the one you're currently writing (say you ls a directory, and then want to cd there, or you cat or less a file and then want to vim or emacs it). And if you have started to write a command and only want part of the autocomplete, alt-right has you covered. Alt-delete and alt-backspace to delete word-by-word rather than character-by-character (what is often ctrl-backspace and ctrl-delete in many text editors). And, of course, the regular up-arrow history scrolling filters by what you have already written.
@soanvig2 жыл бұрын
I love you so much for these tips. I was using fish without knowing prevd, nextd and especially shortcuts for these and other (like sudo) commands. My life will be so much better now. I think fish should advertise those shortcuts more.
@gabrielalvescunha94052 жыл бұрын
Man, the prevd and nextd keybindings made my morning :D. The Alt+s is also noice!
@QuotePilgrim2 жыл бұрын
Fish looked pretty interesting, so I tried it out and set as my shell for a bit... then I started rewriting one of my bash scripts as a fish script, and it was an absolute pain. I gave up when I realized that there was no way to make associative arrays, short of implementing them from scratch. There was also the issue that you need use the math command to do something as simple as incrementing a variable, so something like "((x+=1))" becomes "set x (math $x + 1)", which works, but come on, seriously? My whole experience before I finally gave up rewriting the script was that a lot of things were unnecessarily verbose like that. Granted, I probably would have finished rewriting the script if at the very least fish had associative arrays, but so many lines became about twice as long, and without being that much more readable (when it wasn't less readable), that I would probably have decided it's not a good language to write scripts in anyway. Also, just to make this very clear: I absolutely need my interactive shell to have the same, or the very least very close syntax to the scripts I write. I do not want to type "x=1" when writing a script, but "set x 1" when using an interactive shell, nor do I want to have to use "$(command)" in scripts, but "(command)" in the shell, and so on and so forth. I want to do things the same way in both cases, which is why I use zsh, so I can have some of the nice features fish has, and write my scripts either in bash or as POSIX-compliant scripts. There are a lot less differences to worry about.
@haomingli61752 жыл бұрын
fish is much faster than zsh if you install all the plugins that make zsh fish-like; fish shows the prompt instantaneously, while zsh takes a visible fraction of a second
@QuotePilgrim2 жыл бұрын
@@haomingli6175 Thing is I have no use for most things fish does, and zsh is more than fast enough for me. Regardless, speed is just not that important of a factor for me, it is well behind things like syntax and features like associative arrays and parameter expansion. "for f in *.md; do mv $f ${f%.md}.txt; done" is not something you can do in fish. I'm sure there are ways to achieve the same result, but the point is I don't want to do it any other way, I want to use this exact syntax, any other is unacceptable to me. In all seriousness, the fact that I have to type "set x 1" instead of "x=1" is more than enough reason for me to not even consider switching to fish. Yes, I am that petty.
@michaelcarnevale56202 жыл бұрын
@@QuotePilgrim ya i use fish cuz i like the simple config setup but i agree that the POSIX compatibility issue can be a dealbreaker
@AngelIliikov2 жыл бұрын
Thanks for the tips DT! About the math problem with the wildcard - the standard way, at least from my understanding is to escape those characters. So math 2\*3 works as expected.
@jhonaker762 жыл бұрын
zsh used to be my favorite back in early 2000s. I haven’t run Linux for over a decade, but glad to hear it’s still around.
@DavidHathaway2 жыл бұрын
Like others, I have been using Fish since you highlighted it, but I didn't know these keybindings. The prevd/nextd bindings will revolutionize this for me. Thanks!
@driden19872 жыл бұрын
Been meaning to try fish, but I'm also switching over to emacs, and that's killing all the "learning" time I have lately. A look at NU shell, by JT, would be awesome aswell. He demoed a couple of times and it really brings new stuff to the terminal
@praetorxyn2 жыл бұрын
Fish is the only shell that supports XDG properly. ZSH has ZDOTDIR, but you either have to create an extra dotfile (~/.profile, ~/.zshenv) or edit a system file (/etc/profile) to set it before the shell loads, which largely defeats the purpose of trying to force XDG compliance. Bash doesn't support XDG at all.
@mk72v2oq2 жыл бұрын
Zsh has its own system-wide /etc/zsh/zshenv. But yeah, automatic XDG would've been nice. Btw DT has a video against XDG.
@praetorxyn2 жыл бұрын
@@mk72v2oq Either way. Managing system file changes is not really a supported paradigm the way most people manage dotfiles. It’s something that has to be done manually or scripted, and is thus a pain in the ass fish doesn’t come with.
@mk72v2oq2 жыл бұрын
@@praetorxyn out-of-the-box XDG is better, but zsh is about configs anyway. Fish is essentially zsh + proper config.
@irlshrek2 жыл бұрын
Yeah I can't imagine going back to bash after fish. It's like going back in time but in a bad way. And you're the reason I use fish! So thank you!
@syrefaen2 жыл бұрын
Nice, really cool to learn shortcuts even tho Ive used fish for some years I did not know. Maybe new users should be aware of fish_config command. You can set a theme there an various 'config parameters in a webgui '. Set your favorite terminal to launch fish, and keep the !#/bin/bash in the scripts, not bin/sh and everything will be fine.
@ash1kh Жыл бұрын
I am pretty happy with fish shell and made it my system default because I know i can pretty much run any bash command with bass and replay, the main problem for me was forgetting sudo, and was thinking to make some kind of alias or function that can mimic the bash style "sudo!" to run previous command with sudo priviledge. For a whole year suffered for it. now alt s, man you are my hero..
@falkens_maze2 жыл бұрын
System scripts aren't necessarily written in Bash. I know on Arch you can change it to Dash (for performance reasons). I think they are written in a low level POSIX compliant way so any shell works.
@39zack Жыл бұрын
But Fish is not 100% POSIX compliant (on purpose)
@kasroudra55422 жыл бұрын
Fish is so awesome out of the box that I use it in both my android and ubuntu. The omf framework also made it nicely customizable
@LordHonkInc2 жыл бұрын
I love the fish shell, even if I have some gripes with it (all of which are circumventable, but they're just pet peeves, y'know) it still has so many creature comforts that I miss with other shells, like the mentioned history-searching autocomplete, or the mode indicator for vi bindings, small stuff like that.
@adamgarlow534711 ай бұрын
The nice to haves like directory switching and autocomplete have been fantastic for me but the sudo trick is truly amazing.
@umop3plsdn2 жыл бұрын
I used bash for over 20 years... I knew other shells existed but never really paid it any mind which is crazy cuz I spend literally 90% of my time in a shell. I switched over to zsh and my mind was blown i stayed for like a year or two and kept hearing how fish was kinda like it in some ways so I was like hell i'll give it a shot. I CANNNNNNOT LIVE WITHOUT FISH lolol fish > *
@mk72v2oq2 жыл бұрын
Zsh with some additions easily make fish obsolete.
@@mk72v2oqzsh with those additions is slow, painful to maintain and shit to use Frankenstein's monster.
@MattMcCullough2 жыл бұрын
Fish is my go to shell
@xc13z8292 жыл бұрын
I've been wondering about scripting and shells. If I'm the only one using the script, why suffer through googling for the hundredth time how to get some obscure bashism to work? Why not just script with fish and be happy? I wrote hundreds of scripts on MacOS in zsh, the world didn't come to an end. And installing fish on most distros is easy-peasy. Sooooo.... fish scripting it shall be unless there is a good reason to avoid. Thanks DT for a great video!!
@TheLazyJAK2 жыл бұрын
I was comparing exa and lsd today. An in depth video on them both would be great! I preferred lsd personally but you can make them relatively identical
@owainharris2 жыл бұрын
I prefer mushrooms
@coffeedude2 жыл бұрын
@@owainharris It depends on the ocassion
@TheLazyJAK2 жыл бұрын
@@owainharris lmao
@WayneLansdowne2 жыл бұрын
Maybe I missed it, but what theme is being used for Fish? I really like it. Are there any other customizations done to it?
@j_atkinson2 жыл бұрын
Thanks for the tips! I've been using fish for quite some time along with oh my fish, but I haven't taken a deep dive into the shortcut keys yet.
@_BLANK_BLANKАй бұрын
Yeah. Using fish for the Interactive shell, and bash for my default is what I do. It's perfect for me. I actually have a set up where I set fish as the shell for my main terminal (kitty) then I have a second one with bash like normal (right now st, but in the past alacritty)
@jozsefk92 жыл бұрын
My favourite shell. Using it for few years now
@JakeLinux2 жыл бұрын
I tried both fish and zsh for a while, then I realized I have no need for an extra shell on my system, bash is amazing all on its own. A few little modifications to suit my needs and it is good to go.
@occultsupport22 күн бұрын
what about the syntax highlighting? isn't that a pain to live without?
@JakeLinux22 күн бұрын
@occultsupport not at all, syntax highlighting is nice but not having it is not a deal breaker for me.
@nafg6132 жыл бұрын
Fish is an even bigger win for scripting than for interactive
@pewolo2 жыл бұрын
The Bourne Again Shell (Bash) is the best ever and I love it.
@mcw15933 ай бұрын
I use emacs all day at a large tech company and I do it in the terminal. No GUI active. Yes, it has both modes these days.
@metalnwood2 жыл бұрын
For math, you can also just quote the whole line to make it easier - especially if you had * more than once, e.g. ~>math "55*(9*17)+8"
@methamphetamememcmeth34222 жыл бұрын
I think the abbreviation function is neat as well. I prefer it to aliases because it will always print the original command to the terminal.
@mk72v2oq2 жыл бұрын
Idk, zsh can be configured to do all the fish does and even more. In fact you don't even need to write configs manually, just install 'zsh + grml-zsh-config + zsh-autosuggestions + zsh-syntax-highlighting' and this setup makes fish obsolete. Not saying that you can configure any keybinding to do anything. Configurability and extensibility of zsh is effectively limitless.
@JrIcify2 жыл бұрын
I don't like messing around with configs and plugins very much although I did use tricked out zsh for a while, and my takeaway was that it's for developers who are actively programming while using it. Using it in everyday life felt more forced to me as time went on while fish felt natural pretty much immediately.
@5fr4ewq8 ай бұрын
It's an old comment, but whatever. Zsh is incredibly slow and even with plugins it doesn't do what fish does out-of-the-box. Zsh-syntax-highlighting didn't even worked for me without p10k. Fish is faster, have better syntax and have a lot of features already built-in. Just the reality
@leviticus89302 жыл бұрын
Fork the Fish Shell, put your spin on it, and call it "Dish". Winning...
@tailsorange28722 жыл бұрын
no no, call it "Chips" instead - then we'll have "Fish" and "Chips" 😄
@SgtElev3n2 жыл бұрын
This video should have been titled fish and tips
@polyglotusamericanus41632 жыл бұрын
GhostBSD uses fish by default for the user shell.
@redinetyas15522 жыл бұрын
those keybindings are great thanks for tell us.
@david_handlebar Жыл бұрын
How do you change your termianl prompt's to ">"?
@stevenbacon38782 жыл бұрын
Thanks for making this video, fish is awesome!!
@Little-bird-told-me2 жыл бұрын
i have moved to fish after watching this video. I had no clue as the difference between an interactive shell and system shell
@Kritiqual2 жыл бұрын
Hey dt, can you make a review on wezterm? It is written in rust and config is in lua and has many builtin feature
@shriram54942 жыл бұрын
Is piping cat to less any different from passing the file as an argument to less?
@n5ifi3 ай бұрын
I think fish or zsh is a great idea for a newb. It's quite important to learn the terminal or at least a termianl that can help you. I wish I had had someone tell me this.
@xrenynthemusicmage6422 Жыл бұрын
If you want to save yourself the trouble of installing exa and setting up a custom ls alias for it, try typing "la" or "ll" into a vanilla fish shell :)
@DavidWellsBootBoss4 ай бұрын
Great content man,
@godnyx117 Жыл бұрын
Fish looks and feels amazing but I have found some bugs and also, I cannot get to properly set VIM keybinding and and Cursor styles in different modes.
@Skyler96042 жыл бұрын
Hey DT, would love to see a video on using bash getopts.
@iodreamify2 жыл бұрын
Very nice highlight of the things which are important to an end user. The only thing i'm wondering about is what happens when you execute a script written in bash while running fish. Is it completely incompatible or will it launch bash temporarily?
@clintquasar Жыл бұрын
Incompatible. You can always /bin/bash before running it of you really need to run it.
@prayingmantis862 жыл бұрын
Nice vid. What font is that in the terminal?
@smitty.c Жыл бұрын
how can i get my command line text to be colored like that? i dont mean the prompt
@champfisk56132 жыл бұрын
Well many people probably script on the fly in the interactive to make sure it works. Fish is cool, be it it can be obnoxious due to the non posix compliance
@martinhertz49572 жыл бұрын
Fish is cool. Personally I'd rather include the fish features I want, into the more powerful zsh, which if wanted can do all and more, but to each his own.
@Neucher2 жыл бұрын
Underrated use case for fish: Devices with touchscreen be it android, postmarketos or a Surface device
@alterego1572 жыл бұрын
All 5 of them
@Neucher2 жыл бұрын
@@alterego157 ?
@coffeedude2 жыл бұрын
@@Neucher how do you use a shell on android?
@Ax4400 Жыл бұрын
Thank you, had no clue what fish was but kept seeing it sys tools, like so many other apps. Totally unrelated question about running a communication app ie. whats app, in a secured isolated sandbox, running garuda lxqt kwin. Someone keeps sending me a link to connect on whats app but I'm afraid of the security risks of running that app on my build & I really want to communicate with this person re: current journalism.
@maxifittipaldi98432 жыл бұрын
Very useful, thanks so much!
@Cuissedemouche2 жыл бұрын
I love fish and using it, but I wouldn't put it on default. When new users are lost, they'll look/ask for help and they'll have command that are sometimes not compatible with fish.
@gokul2003g2 жыл бұрын
12:46 fish doesn't have sudo !! Now I know why and the workaround.
@taragwendolyn2 жыл бұрын
fish + thefuck. love 'em both, and have 'em on any system I set up now.
@joffreybluthe79062 жыл бұрын
For the math function you can also escape the * with \ (e.g. math 2\*3) but I'll admit that it's still a bit clunky :)
@NickyDekker896 ай бұрын
Kali also comes with Zsh out of the box.
@coffeedude2 жыл бұрын
I haven't watched the video all the way through but I think my shell can do all that stuff. I will come back to confirm tho
@randomname24372 жыл бұрын
alias --save is my favorite
@amerikraine34012 жыл бұрын
Hey dt do you have your config for fish shell? It looks good I'd like to try it
@Little-bird-told-me Жыл бұрын
You can type $EDITOR to open the default editor in fish.
@rochr42 жыл бұрын
for now I launch fish to exploer a new command, got so many prosthetics in bash already that it's not much appealing ;)
@anon_y_mousse2 жыл бұрын
I see that you use --color=always, and I wonder if you find that it interferes with piping to other commands? Less is generally fine with colors for me because I can just -r it, but if I'm grepping for something it gets a bit wonky. Also, I like the way bash does math better, $(()) and everything in between is interpreted as just math operations, complete with variables, and if a wildcard doesn't match on the command line it just accepts it as a plain string instead of throwing an error.
@d3j4v002 жыл бұрын
Since I've found fish I've put it on all my Macs
@wisnoskij2 жыл бұрын
I feel like most of the features of the special shells really should just be terminal emulator features. People dont really want Fish the language, they just want autocomplete.
@ironmanlifts2 жыл бұрын
Hey DT why are you still using 'cd' ? I move around my entire file system with 3 letters thanks to zoxide.
@rijothomas54782 жыл бұрын
Best thing is you don't has to 'cd' everytime. 😁
@jellyfp2 жыл бұрын
Been using fish shell ever since I started using linux! Only gripe I have is how it's not compatible with bash scripts
@Paul-vi3on2 жыл бұрын
But that doesn't matter much; any (good) script should be prefaced with the correct #!-shebang anyway (indicating with which shell to run it). I think if the shebang is missing entirely, fish even assumes it's written in bash. So as long as you don't plan to completely uninstall Bash from your system (**don't**), or write scripts in Fish for other people, you won't have any problems.
@AndersJackson2 жыл бұрын
I used Emacs a user shell, but that wasn't that great experience, as many scripts back then didn't have the hash-bang line in the beginning. 🙂😎
@mrcat96972 жыл бұрын
the only reason I watch DT is "Let me switch over to my desktop"
@elabeddhahbi33012 жыл бұрын
anyone know how to write on more than one monitor in dtos sometime I open more than one server and I wanna type the same command
@knotguru34232 жыл бұрын
Try kitty.
@PranavBhattarai2 жыл бұрын
Alt S ------------>> amazing
@theodorealenas31712 жыл бұрын
His mind is a just in time compiler I swear. He compiles new information into teaching material on the fly. He learned it? He taught it. I can't do that.
@amynagtegaal69412 жыл бұрын
Fish has a lot of stuff by defautl but everything fish can zsh and bash can too but it requires a lot of effort with bash and with zsh actually not that much
@jaimesotelo42522 жыл бұрын
As always nothing that isn’t already possible in bash. The prevd feature is nice, though. And would require some scripting to implement in bash. Anyway no killer feature that could convince a well educated bash user.
@Jeff_Seely Жыл бұрын
Amen to fish!
@sumirandahal762 жыл бұрын
Hey DT, how's openSUSE tumbleweed ?
@nevoyu2 жыл бұрын
I use fish shell scripts for my d&d campaign, lmao
@thingsiplay2 жыл бұрын
The default shell on Linux is /bin/sh
@DistroTube2 жыл бұрын
/bin/sh isn't an actual shell. /bin/sh is just a symlink to your system's default shell...which is Bash on almost every Linux distro (Ubuntu uses Dash for its system shell).
@thingsiplay2 жыл бұрын
@@DistroTube I know, it was a joke because one of your older videos talking exactly about this.^^ I have set it to Dash.
@emacsking43102 жыл бұрын
Second (Maybe)
@depiction34355 ай бұрын
fish + tillix is boss
@jocadbz2 жыл бұрын
My shell indeed does that. I use Fish btw
@eduardpopescu91092 жыл бұрын
try typing 'fish_config' in your fish shell...see what happens
@BorosBlake2 жыл бұрын
Hey guys! How can someone contact DT other than Patreon ? I some problem wasnts featured yet.. Would be good to have a solution cuz the ArchWiki information not helped, but have to be a way to make it work... Thinkpad WWAN card to work with 4G LTE build in modem. SIM card is in, but the qualcom or which driver worked perfectly under Win10, now not wanna work under Arch.. Anyone had similar problem?
@gogogogogogogogogogog92 жыл бұрын
best shell is ash
@ao1pointblank2 жыл бұрын
I think I prefer the keybinds for zsh a bit more
@JesseNeckred2 жыл бұрын
Some cool stuff for sure. But since cd has it built in, every shell can go next or previous with directories. Just bind "cd -" to go previous, and "cd -L" for next.
@jaimesotelo42522 жыл бұрын
That only takes you back one time, not all the way back. In bash there are push and pop but it’s not the same
@rashie2 жыл бұрын
👍👍
@lightprogrammer2 жыл бұрын
Are you pulling our leg?
@NimXD2 жыл бұрын
I must try the 0/0 and see my distro crash and burn
@nafg6132 жыл бұрын
Builtins are not the same thing as functions
@amerikraine34012 жыл бұрын
Fish is too slow , it drives me crazy. I tried to force myself away from bash but I cant