yego.me
💡 Stop wasting time. Read Youtube instead of watch. Download Chrome Extension

Terminal Lesson 7


2m read
·Nov 3, 2024

Processing might take a few minutes. Refresh later.

That gets here today. This is another terminal lesson. Now I am going to show you how to use the find utility. This find utility allows you to find files and folders on your system.

Let's start out. I defined command find space then the location we're looking in. I'm going to do dot space dash name space the name of the file or folder space dash print space to greater than / dev / null. What the to greater than / dev / null is saying is take the errors and instead of writing them to the terminal, write them to / dev / null.

You can change it to write for the errors, the dot slash desktop / error log. Now there are not going to be any errors because I'm looking right now in my home directory, which is currently dot my pwd. We hit enter, right? There is error log. So it looks like there was an error apparently or something.

Now it shows us that desktop programs is where my programs folder is, and I'm just going to throw this file out. I don't need that. Let's open up error log. No errors! It's a clean slate, great! So, I'm just going to delete error log too.

Now let's do something a little more interesting. We're going to look for programs in /. What this is going to do for us is it's going to find all the directories with the name programs that we have permissions to view. If we don't have permissions to view it, it's going to take this and write the error to my desktop under file error log.

We hit enter. Error log is here on my desktop already. There were probably already some errors. It's going to be a while before it finds my programs folder in my home directory, so I'll do a long here.

Okay, so as you can see, it has finally found programs in / user / alec / desktop / programs. I'm just going to demonstrate this to you and open up error log. We're going to see how much stuff is in here. These are all the permissions denied. These are all the files that I didn't actually have the permissions to read, which is why find brought up all this error.

Now, if I hadn't typed this error to dot slash desktop error log, which is the file right here, would have gone right to the terminal and I would be seeing it all on the terminal. You can see I can get rid of this whole thing, so it’s just up to print, and all this error crap already has come up. How nice is that?

It's so wonderful that you can just do this and pipe only errors. That's what to means. The greater than means take it to this and so and so.

Alright, now that will overwrite the last log of errors. If you want, you can do two greater than symbols there and a greater than symbol, shift shift dot shift period. So, you can do two greater than symbols there to append to that file instead of overriding that file every time that you do this command.

So, that's how to use the find function to find stuff. I showed you how to pipe the errors into a file, and yeah, that's how to use find. Congratulations! Thanks for watching, Mac heads! Be sure to watch more of our videos, and goodbye!

More Articles

View All
The Fastest Way To Find Waldo
Here’s how to become scary good at finding Waldo. In 2015, data scientist Randall Olssen used all 68 of Waldo’s hiding spots in the seven primary books to build this kernel density estimate. So where’s Waldo really? He’s here! Now, there are more ways t…
What IS THIS??? IMG! 15
Don’t be scared. Relax and snuggle up. It’s episode 15 of [Music]. These shoes look nice, but when you wear two and put your heels together, it looks like—oh! And here are some shoes from designer Brass Monkey: R2-D2, Batman, Robin, Mario, Luigi, Woody, …
Can Ugly People Get Rich Too? | Ask. Mr. Wonderful #12 Kevin O'Leary
Oh that, that’s gonna require a sip of wine. Leah, that’s a really tough question. [Music] Okay, so we’re gonna have a really interesting session of Ask Mr. Wonderful today because of one of my most, I guess, favorite places. I’m in an FP Joran watch bout…
Saving Albatross Chicks From Tsunamis and Rising Seas | National Geographic
The Laysan albatross chicks that we’re raising, they have a lot of personality. When you first look at them, you wouldn’t realize how much variation there is among different birds, but there really is. A feisty one, aren’t you? Yeah, he’s got lots of ener…
Example of hypotheses for paired and two-sample t tests | AP Statistics | Khan Academy
The Olympic running team of Freedonia has always used Zeppo’s running shoes, but their manager suspects Harpo’s shoes can produce better results, which would be lower times. The manager has six runners; each run two laps: one lap wearing Zeppo’s and anoth…
Too HOT for Disney? ... and Mario Goes Crazy! IMG! #26
Famous things as Pac-Man ghosts and a hot Myspace photo dog toilet. It’s episode 26 of IMG. Giraffes can kiss, but when people kiss, a giraffe can be hidden. Dash Coleman made game over decorated with classic video game deaths. On a related note, Luigi i…