Demystifying 'find' and 'find -exec' ...Lil' Linux Lesson!

preview_player
Показать описание
Has the internet told you Linux' "find" command is too scary to use? Well, they're wrong. Linux' "find" command - also found in lots of other *NIX systems - is a critical tool to learn.

In today's Lil' Linux Lesson, I'll be demystifying the "find" command, and covering how it works with the "-exec" option, and the superpower differences between using "+" and using ";", which I promise will make your life easier as a sysadmin, Linux user, or just any nerd who likes to play with the terminal.

Lastly, this video wouldn't be possible without my monthly sustaining supporters on Patreon and Ko-Fi. Members get a bunch of cool perks- if my unsponsored videos help you, I appreciate your consideration!

0:00 I say "greetings" and tell you why the find command is important
1:24 Basic use of find, both GNU and BSD variants!
2:46 Performing magic in the terminal with find -exec
4:56 Some other parameters for find: -iname, -type, -user, -group, -perm, -size
6:53 Why does find -exec end with a plus?

#linux #homelab #terminal
Рекомендации по теме
Комментарии
Автор

Some of you commenters are pointing out, accurately, that `grep` can recursively search files on its own, without `find`. Of course it can! But remember, grepping was just the example I was using to illustrate `-exec`. Your options between `-exec` and `{} +` are practically limitless.

Also, to those of you about to voice your displeasure with "needing the terminal to find lost files", your assignment is this word problem: "Susie has a VPS running a web server, and her server daemon has crashed due to a malformed configuration file. How can Susie identify and resolve the problem using only GUI tools and no terminal commands?"

VeronicaExplains
Автор

I'm a retired UNIX/Linux System Administrator (30+ years) and I find your content refreshing and more to the point very useful! Yeah there are newer and perhaps simpler commands, but knowing the basics is still very important. People would ask me why learn vi when there is nano for example. Because from AIX to (name your Linux distro) etc, you'll always have vi :) Thanks again for your hard work and keep keep doing what you're doing!

robbylock
Автор

Keeping up with the Commodore would be a reality show I would actually watch

greendblink
Автор

In my 30 years as a sysadmin, I've never heard of the +. I've always used the \; when using -exec. Thanks.

chadcordero
Автор

I like the part where veronica says "its explaining time" and explains all over the place

Andoresu
Автор

Holy Crap! 30+ years in this business and I *just* learned about '+' as an argument to find.
How much of my life have I wasted to \; ?!
Thanks Veronica! You're frickin' awesome!

ducksauz
Автор

It's a good day when there's a new video from Veronica!

Richthofen
Автор

This was a real "+" for a topic. I use "find" nearly every day and did not know it has alternate endings \; Thanks.

jefflsmith
Автор

Started using Unix on a VAX 11/780 in the '80s before you were born!! But you're never too old to learn something new! Been using "\;" since then, and only just now learned about "+"! Thank you.

petermayes
Автор

As someone who was "cool" in the mid-nineties, I appreciate the spacehog based puns.

dkieC
Автор

Thank you! Because honestly, even as a somewhat experienced Linux user, learning these types of tools is hard, because you only use it when you needed by looking at the long documentation, then you never touch it again so you forget. Then when you needed it once more, it's the same tedious process. A fun video like this is perfect to master a tool like this!

Aura_Mancer
Автор

Your no nonsense explanations are great!

UnwalledGarden
Автор

I prefer `find | xargs grep` because it executes grep one time across all the found files instead of executing a separate grep for each file as find -exec would do. find | xargs grep is often an order of magnitude faster when grepping a lot of files.

EDIT: OK I wrote the above before I finished watching the video! And I see the the '+' form of exec does effectively the same thing. Wow I learned something new after using find daily for about 25 years. Thanks!

zantetsu
Автор

The find command can be insanely powerful. I just learned the (+) versus the (;). Thank you for that. I had always used ; and didn't know about the +

ftolead
Автор

Linux has been my development platform for work for nearly a decade, but I still watch these videos because of how fun they are. And speaking of keeping up with the Commodore, I haven't written a BASIC program in years, I realised I miss it.

thekidneystoner
Автор

Been a Linux user for 20+ years. Love your videos and how you extend your knowledge to newer users. Keep it up.

paul.j.macdonald
Автор

I love these videos -- if I ever have any kind of "virtual assistant" on a Linux machine, I want the voice to be Veronica Explains in 8th grade math teacher mode.

CurrentlyVince
Автор

Are you keeping up with the Commodore?

Love your channel ! Very informative and entertaining !

remi
Автор

I've been a professional Linux sysadmin since the 90s and use the find command all the damn time. This intro was perfect, and it taught me something I didn't know - ending the command with a plus instead of a semicolon. That's super useful in many contexts - thanks for that!

flapjack
Автор

Thank you for doing these Lil' Linux Lesson and concentrating on the commands that builtin rather than the newer that are not always in the repo's.

kev-zs