Тёмный

The Amazing Interactive Command Line Fuzzy Finder (fzf) 

DistroTube
Подписаться 250 тыс.
Просмотров 49 тыс.
50% 1

Have you heard of the command line tool 'fzf', aka. the Fuzzy Finder. It's an interactive Unix filter for command-line that can be used with any list. It's similar in concept to graphical tools like 'dmenu' or 'rofi' except 'fzf' is a CLI tool.
REFERENCED:
► github.com/jun...
WANT TO SUPPORT THE CHANNEL?
💰 Patreon: / distrotube
💳 Paypal: www.youtube.co...
🛍️ Amazon: amzn.to/2RotFFi
👕 Teespring: teespring.com/...
DONATE CRYPTO:
💰 Bitcoin: 1Mp6ebz5bNcjNFW7XWHVht36SkiLoxPKoX
🐶 Dogecoin: D5fpRD1JRoBFPDXSBocRTp8W9uKzfwLFAu
📕 LBC: bMfA2c3zmcLxPCpyPcrykLvMhZ7A5mQuhJ
DT ON THE WEB:
🕸️ Website: distrotube.com/
📁 GitLab: gitlab.com/dwt1
🗨️ Mastodon: fosstodon.org/...
👫 Reddit: / distrotube
📽️ LBRY/Odysee: odysee.com/@Di...
FREE AND OPEN SOURCE SOFTWARE THAT I USE:
🌐 Brave Browser - brave.com/dis872
📽️ Open Broadcaster Software: obsproject.com/
🎬 Kdenlive: kdenlive.org
🎨 GIMP: www.gimp.org/
🎵 Tenacity: github.com/ten...
💻 VirtualBox: www.virtualbox...
🗒️ Doom Emacs: github.com/hli...
Your support is very much appreciated. Thanks, guys!

Опубликовано:

 

12 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 90   
@themroc8231
@themroc8231 Год назад
So cool! I'm glad you saw my question on Mastodon. An important difference with Dmenu or Rofi is you can misspell: fzf can search similar results taking into account interpolations of letters, missing letters, extra letters, etc. That's the "fuzzy" part. Sounds like a detail, but in real life that's what makes it so fast and efficient to use.
@MasterHigure
@MasterHigure Год назад
At my previous workplace, a colleague installed fzf on one of the remote servers, and I discovered that it made ctrl-r a dream. The history search became a LOT easier. I admit I have no idea how he made the bash history search use fzf rather than the default, but it was wonderful.
@keyboardwarrior6296
@keyboardwarrior6296 Год назад
fzf comes with a few scripts that are included /usr/share/fzf/. You just source them in your bashrc or zshrc.
@keyboardwarrior6296
@keyboardwarrior6296 Год назад
The key-bindings scripts come with three keybindings, also. ctrl-r for history, ctrl-t for files under the current dir, and alt-c to cd into dirs under the current dir.
@samoylov1973
@samoylov1973 Год назад
Thanks DT! Here are a few aliases that I use with fzf. They might be useful to others. Especially the ones with preview part hf='history -100 |fzf' mpf='cd ~/Videos && mpv "$(fzf)"' pf='fzf --preview='\''bat --color=always --style=plain {}'\'' --bind k:preview-up,j:preview-down' sqf='sqlite3 "$(fzf --prompt "Please select a database: ")"' vf='vim "$(fzf --preview="bat --color=always --style=plain {}" --bind K:preview-up,J:preview-down --prompt "Please select a file to edit: ")"'
@glidersuzuki5572
@glidersuzuki5572 Год назад
You can turn these into functions which check whether the fzf result is empty or not before executing them. So, you won't open the program, eg :- mpv if no results are chosen
@samoylov1973
@samoylov1973 Год назад
@@glidersuzuki5572 good point. But these ones are aliases. And "mpf" cds into ~/Videos first. I know there are some videos there. So (only after 'cd' to a folder) second program 'mpv' is started.
@glidersuzuki5572
@glidersuzuki5572 Год назад
@@samoylov1973 I have the alias for vim. But sometimes I decide I have to do something before editing the file and I press ctrl-c but vim opens anyway
@samoylov1973
@samoylov1973 Год назад
@@glidersuzuki5572 one possible way out is to press CTRL+Z == sends current process to pause state. You can decide what to do with it later. Either you kill it, bring to foreground with fg, or run in the background with bg. Hope, this helps.
@n0kodoko143
@n0kodoko143 Год назад
Thanks as always, Derek! A couple of thoughts: 1. (Use case between dmenu/rofi vs fzf) - if you work in an environment where other consumers of your scripts don't have the xserver/ xserver programs, fzf of bound to the terminal. 2. I like to use fd or find to get around the issue you experienced where the script only ran in the absolute path. i.e: $ fd . ~/wallpaper/ -e jpg | fzf | xargs Great thing about programming, so many different ways to a solution! Just in case it helps some other viewers (nice touch using sxiv - I think - as a visual filter)
@mjdstratocaster9716
@mjdstratocaster9716 Год назад
fzf man page finder/viewer: apropos -s 1 . | fzf --preview='man {1}' --preview-window=up Scroll with shift-up shift-down fzf package finder/info viewer: pacman -Q | fzf --preview='pacman -Qi {1}' --preview-window=up Can modify for apt, dnf, etc... Can add keybindings to install/remove selected package(s).
@theodorealenas3171
@theodorealenas3171 Год назад
fzf project picker, Emacs inspired: cd "$(find ~/projects -name .git -exec basename {} \; | fzf --preview "tree {}")" (This is not how I do it, but it used to be how I did it more or less) fzf git checkout thing for some reason git log --oneline --all --graph | fzf --preview "God knows what" | sed 's/[*/\| ]\(\S\).*/\1/' | xargs git checkout I guess. I hope.
@soanvig
@soanvig Год назад
Fzf has some powerful options allowing you to build custom commands with a dedicated menu bar inside fzf effectively turning it into full blown TUI for many programs that may need it
@fanaFSF
@fanaFSF Год назад
Instead of "command ls" you can do it like this: "\ls"
@DistroTube
@DistroTube Год назад
True, but I'm not usually running Bash. Mostly spend my time in Fish and the backslash trick doesn't work there. But 'command' works everywhere. ;)
@ewrietz
@ewrietz Год назад
I knew about \ls but not command ls
@driden1987
@driden1987 Год назад
fzf is awesome, changed my workflow so much
@jaxxarmstrong
@jaxxarmstrong Год назад
Better late than never, sir 😉😎
@glidersuzuki5572
@glidersuzuki5572 Год назад
Fzf is life. Fzf is love
@sumirandahal76
@sumirandahal76 Год назад
You always introduce us to the awesome utility.
@CiberBago
@CiberBago Год назад
Thank you, it's a great tool. I needed something like this for a long time but I didn't know how to search for it.
@futz48
@futz48 Год назад
Cool. I had never heard of fzf. Your home dir had 221K files in it. Mine had over 11 million. This box has been around a long time.
@Polar_Onyx
@Polar_Onyx Год назад
At that point I'd just do a fresh install, it's not worth your time to sort through all that or to even attempt trimming it down
@futz48
@futz48 Год назад
@@Polar_Onyx Hahaha! You have no idea. That rig has terabytes of storage - all full (and all well backed up). It's pretty well sorted and organized. No trimming down will happen. I love to collect stuff.
@linuxrant
@linuxrant Год назад
The wallpaper setter combination could work really cool with feh. I tried some other day to set a very low-res pixel art wallpapers, but nitrogen was incapable of not making an ugly blur of enlarged pixels. Once I learned about feh I was relieved, cos it had a function to remove any ugly blurring from the upscaling. But it was tedious to put all those flags in the feh command... a bash script + fzf could make a usefuyl combination of a pixel-art wallpaper chooser :)
@eriklundstedt9469
@eriklundstedt9469 Год назад
I think I wrote a wallpaper setter using fzf a couple of years ago... One moment and I'll link it if I find it
@Babk0ck
@Babk0ck Год назад
There's a lot to that program, you can use environment variables to customize its appearance!
@xwinglover
@xwinglover Год назад
That is awesome. Great video man!
@musictube6672
@musictube6672 Год назад
I've learnt so much from this guy
@theodorealenas3171
@theodorealenas3171 Год назад
COME ON! --preview is the reason of fzf! It's the reason to replace dmenu with a terminal with fzf in it! It can act like NeoVim telescope, or it can give you the manual of the program you're about to run, or a preview of a file, or stats about a system process..
@sys7emH4cked
@sys7emH4cked Год назад
Great Tutorial, DT! 👍
@ratchetwise440
@ratchetwise440 9 месяцев назад
Fuzzy finder. I'm old. I was thinkin' Craigslist personalzzz
@diveallz1044
@diveallz1044 9 месяцев назад
I wish i was like DistroTube in the aspect of being able to keep up with all those folders/files in my home directory😅. Normally if i dont need it for daily use i just put it on a flash drive😂
@zenitsu2989
@zenitsu2989 Год назад
With you onboard linux still is an interesting section to explore.
@dod_ytent9984
@dod_ytent9984 Год назад
I will use this more than sed/awk for sure. Thanks for the great video D.
@terrydaktyllus1320
@terrydaktyllus1320 Год назад
I don't understand the comment - fzf, sed and awk do completely different things anyway, one does not replace the other two for any reason that I can think of.
@dod_ytent9984
@dod_ytent9984 Год назад
@@terrydaktyllus1320 I mean utility wise, I use fzf more than sed or awk, not as a replacement.
@terrydaktyllus1320
@terrydaktyllus1320 Год назад
@@dod_ytent9984 "I will use this more than sed/awk for sure." I am just holding up a mirror to your own words - and what concerns me more is if you think sed and awk are "alternatives" to fzf, then you really can't know sed and awk that well in the first place. "fzf" = "fuzzy file finder", it finds files, like "find" does. "sed" and "awk" allow pattern matching and string replacement *INSIDE* files, i.e. once you have found the files. So do you understand now?
@dod_ytent9984
@dod_ytent9984 Год назад
@@terrydaktyllus1320 ok, i will try my best to be more clear. I know what sed, awk and fzf do, and i know that each perform separate functions. I meant to say, in my day to day, i need what fzf does more than what sed/awk does, thus i use it more than I do sed/awk. Along with that this was a callback to DT's awk and sed tutorials.
@terrydaktyllus1320
@terrydaktyllus1320 Год назад
@@dod_ytent9984 You don't need to explain yourself, it's just important to be factually correct. Someone corrected me the other day because I was wrong about something I said about ARM CPUs - I also say incorrect things sometimes too!
@marcins.7445
@marcins.7445 7 месяцев назад
Guys, more people need to sponsor fzf. It has 57k stars and only 50 sponsors!!
@Tuishimi
@Tuishimi Год назад
That is a useful tool I was unaware of.
@MauricioLuisdeMedeiros
@MauricioLuisdeMedeiros Год назад
Seriously DT?!?! You have this Ubuntu Compiz video sitting on your home folder since 2014? Was it an Easter egg?
@zinoubensalah8939
@zinoubensalah8939 Год назад
Hey DT! when are you gonna inspect Hyprland ? i think it's still needs some work but i was hoping to see your perspective on it.
@WippSheridan
@WippSheridan Месяц назад
We all want a fuzzy finder but as long as it doesn't take screenshots
@terrydaktyllus1320
@terrydaktyllus1320 Год назад
Thank you for this extremely useful video - I don't always agree with everything you say but it's your channel and "you do you" - but I hadn't ever considered using fzf until your video today explained it so well, and that's from someone who started with Linux back in 1996! I've just realised how useful fzf actually is.... though vim is still better than emacs!
@eriklundstedt9469
@eriklundstedt9469 Год назад
I've written a "library" in fennel (works for fennel and lua) so that I can use lisp (fennel is lisp that works like lua) to write shell scripts using fzf. I personally prefer Emacs over neovim though but if you are comfortable with lua, that's good
@HelmutFischer-thehefi
@HelmutFischer-thehefi Год назад
Very helpful! Thx!
@idjdbrvvskambvvv9007
@idjdbrvvskambvvv9007 Год назад
d menu +fzf is unbeatable
@omarabdelhameed349
@omarabdelhameed349 Год назад
Thanks D, ma I ask which keyboard is this?
@muddyexport5639
@muddyexport5639 Год назад
Cool vid. Thanks!
@matt92hun
@matt92hun Год назад
You can make terminal apps run in the background with Ctrl+Z.
@anon_y_mousse
@anon_y_mousse Год назад
Apparently I downloaded a copy of this last year and never installed it. I guess this'll be the push to play with it.
@terrydaktyllus1320
@terrydaktyllus1320 Год назад
I'm the same - I knew of it and took the attitude "maybe I'll check it out some time" but it took his demo here to make me realise how useful fzf can actually be. To give Brodie Robertson some credit too, he did a video on it a few years ago and that's also worth a watch.
@cesar1087
@cesar1087 Год назад
How do I get the sugestions when you start typing? Is this another tool?
@heroe1486
@heroe1486 Год назад
nice video thanks
@felipemachado4323
@felipemachado4323 Год назад
How do you do to get command suggestions on terminal?
@brickviking667
@brickviking667 Год назад
"...calculate about two hundred and twenty thousand files...". I can't do that on my system. I'm over 2.5 million and counting...fzf hasn't stopped yet.
@PrabhuKumar-er5fo
@PrabhuKumar-er5fo Год назад
Is there any fork with fzf with vim simple navigation
@5ebastiancarlo5
@5ebastiancarlo5 Год назад
hey dt do a video about where to split windows: window managers, terminal multiplexes, vim/emacs windows, all off them?
@valentynmudryk2869
@valentynmudryk2869 10 месяцев назад
I can't use two fzf in one command
@ChristyGale-l8c
@ChristyGale-l8c Час назад
Clifton Mill
@postmaster-p
@postmaster-p Год назад
CP3🙌
@Axlefublr
@Axlefublr Год назад
I *just* recorded two videos on this lmaooo
@terrydaktyllus1320
@terrydaktyllus1320 Год назад
There's some interesting-looking content in your channel, thanks for the heads-up.
@Axlefublr
@Axlefublr Год назад
@@terrydaktyllus1320 Thank you! I hope it's gonna be useful to you :) There's a playlist on Linux related things, and also one on neovim if you use that / are interested in figuring it out
@ecavero1
@ecavero1 Год назад
I started using this in Vim. Then, I kinda knew how to pipe things into fzf to search for things instead of files. But I totally forgot that fzf sent the ouput to stdout!
@anon_y_mousse
@anon_y_mousse Год назад
Okay, but why do you have a problem with stdout? Did it steal your /dev/random and give you predictable output?
@ecavero1
@ecavero1 Год назад
@@anon_y_mousse I didn't have a problem with it. It simply did not occur to me I could pipe the output from fzf to another program, like mpv, for example! Anyway, now I know.
@anon_y_mousse
@anon_y_mousse Год назад
@@ecavero1 So if it sent it to stderr you wouldn't have liked to use it? I can understand that complaint, I hate having to redirect stderr for such programs, ffprobe being a prime example of such annoyance.
@sebaszwarc
@sebaszwarc 10 месяцев назад
Problem with these powerfull tools is in ordinary life you very rarely have usecase for this
@MorrisValentine-t9r
@MorrisValentine-t9r День назад
1663 Minnie Ridges
@KirbyZhang
@KirbyZhang Год назад
how can you remember these commands if you're not doing system administration everyday?? that's what kept me away from Linux. It's fun when you learn it the first time, but too much knowledge needs to be ingrained and maintained, to do uncommon things. that's why I'm interested in there being a hybrid text-graphical interface, where mouse and keyboard form separate focus cursors. as you type the graphics change to show the content and the options, you can click to add to the text, without losing focus. this would be a new compositor/server based on Wayland and Weston.
@terrydaktyllus1320
@terrydaktyllus1320 Год назад
"how can you remember these commands if you're not doing system administration everyday??" You make notes, read man pages and/or create web bookmarks to the sites or searches that you use regularly. I started with UNIX-like systems 30 years ago and I still do just that, I don't even try to remember everything. Plus you can use shell aliases or "one line shell scripts" to shorten longer commands also. Linux just gives you "a box of tools", you have to learn how to use those tools.
@PatriciaPuskas-l4s
@PatriciaPuskas-l4s 5 дней назад
King Knoll
@DeborahRobinson9Lopez-h1s
@DeborahRobinson9Lopez-h1s 11 дней назад
Bashirian Way
@AndreiRobertYTlolYes
@AndreiRobertYTlolYes Год назад
Hey new Linux Trisquel 11.0 2023
@DelbertOsaki-h2y
@DelbertOsaki-h2y 3 дня назад
Aniya Village
@DelilahMielczarek-k7j
@DelilahMielczarek-k7j 8 дней назад
Roberts Circle
@BunyanGenevieve
@BunyanGenevieve 7 дней назад
482 Roberto Plaza
@JonathanSteadman2003
@JonathanSteadman2003 Год назад
Hey distrotube, you are the greatest youtuber ever. Thanks for your support on our open source software and community. It means the world to me and billions of other people. Robonuggie has played my games before and that was amazing. So yeah, I just love making open source projects.
@IvethFonsecaop
@IvethFonsecaop 11 дней назад
Garcia Mark Perez Eric Young Frank
@ElArboool
@ElArboool Год назад
Zed*
@DonovanInocencio-u3i
@DonovanInocencio-u3i 2 дня назад
Lesch Loop
@sbr895
@sbr895 Год назад
First.
@lqlarry
@lqlarry Год назад
I missed it by that much.
@PriceNelly-c1p
@PriceNelly-c1p 10 дней назад
Botsford Union
@MerkDolf
@MerkDolf Год назад
Ah,
@fabricio4794
@fabricio4794 Год назад
I Hate Command Lines
Далее
Learn The Linux Terminal In 30 Minutes
39:32
Просмотров 59 тыс.
Xargs Should Be In Your Command Line Toolbag
16:24
Просмотров 99 тыс.
How Strong is Tin Foil? 💪
00:26
Просмотров 48 млн
7 Amazing CLI Tools You Need To Try
18:10
Просмотров 327 тыс.
#fzf - FuZzy Finder Tutorial
31:44
Просмотров 34 тыс.
Fish shell for beginners
8:54
Просмотров 1,1 тыс.
12 GREAT command line programs YOU recommended!
16:25
Просмотров 260 тыс.
Two Powerful Command Line Utilities 'cut' And 'tr'
15:18
FZF Will CHANGE How You Work
9:30
Просмотров 46 тыс.
Intro to fzf
8:35
Просмотров 18 тыс.
9 AMAZING COMMAND LINE TOOLS for Linux
17:09
Просмотров 114 тыс.
What If Linux Became More Popular Than Windows?
14:46
7 Apps Better Than The Defaults Your Distro Ships
12:43