 Hello, and welcome. Today I'm going to quickly go over a few different ways to search for files from your Linux shell using the find command and search through files by date. So here I am, I'm in a directory that has a backup of pretty much all my photos I've taken with my cell phone over the last seven months or so. So let's go ahead, and of course if I just list, I can list them all out, photos and videos. But let's say, and then the find command of course will list them out differently, but list them out nonetheless. Let's look at this, and let's go ahead and try to find all files that are, were updated in the last day, which actually may not result in anything as I haven't backed, I'm backing things up to a new folder now. But let's go ahead and just say find, I could type today find dash newer mt and I'll talk about that in a moment, if I say one day ago, and oh, there's one video in the last day, but I can also say three day, I can say day or days, it knows what I mean, it will return the same thing. It's fairly smart, last 30 days, or last five days, oops, five days. Okay, so how does this work? What does this mean? Well, obviously dash newer means newer. If I was to man, oops, look at the manual, so man find, I can look at, let's say, I'm going to search for birth. So here's the section where it talks about this. So newer, and then x, y, x and y can be one of these here. We're doing mt, so we're doing modified time, and then we're also doing reference to the last, interpreted directly as a time. So here we're looking at the last, sorry, blah, blah, blah. M is modification, so that's the last time that file was modified, and then we're all saying we're giving it a time, so that's what date is. So we're saying look at the last time it was modified. You can also look at things like the last time file was accessed or birth time. But use whatever fits your situation. So let's go back to that, now that we know what that means and look at it again, I can say 15 days, so newer than modified time of 15 days ago, and there we go. I can, instead of 15 days, I can say one month, and it knows what I'm talking about. I can say 10 months, I can say one year, okay? So we have a few different things here, and it's listing out the files. If we want more information on these files, we can add to the end of that command dash LS, and now fine, we'll list it out as LS with all the information there, so you have all the permissions and file size and dates and all that stuff listed there as well. Other options, so we're looking at newer, another option you could do is instead of, let's just do this, fine, I can also say M time, and I can say dash one. And that will be minutes, or no, I'm sorry, days, that's one day. So I can go one day, so minus means going back, now 10 days. So that's another way to write it. I can also say instead of M time, I can say M in, and it'll go back 10 minutes, which there's nothing new in there in the last 10 minutes, 100 minutes, 1,000 minutes, I'm not sure if there's a limit, there we go. So 10,000 minutes back, but you can go back a certain number of minutes. So if you want to see everything new in the last 10 minutes and do something with them, you can do that. Another option is going back to our way of doing it before. Instead of saying one year ago, let's say I want to say from a certain date, so since February 1st, and by default it will know of this current year, or the last February 1st, so there we go, or I can say March 1st, and it'll bring up everything since March 1st. So that's everything that's, we've gone over everything newer since a given time or date. Let's say we want stuff that's older. Well, going at our previous commands here, the dash M minute, instead of 1, I can say plus 1, instead of minus 1. Now it's showing everything more than a minute old, or more than 100 minutes old. So if you want to do in the last hour, I can date everything that's older than the last hour. So don't show what's been put in there in the last hour or modified in the last hour, everything before that. So now we're going older instead of newer. We can also do dash T, or dash time, I mean. So now I'm saying this, and I can say, before we did minus 1, and that shows everything in the last day, well, if I do plus 1, I'm showing everything older than a day, or older than 10 days, or older than 100 days, or older than 1,000 days, which is nothing because it's nothing before the new year in this folder. Okay, so we've looked at newer, and we've looked at things older. Let's look at trying to find things between a certain date. So what we're going to do here is we're going to say, fine, we're basically going to combine two things here. We're going to say dash newer, MT, so modified time, and we'll give it a date. And again, it's very smart, you can write this many different ways. But let's say 2019, January 1st. So we want everything that is newer than January 1st, exclamation mark that is not newer with the modified time of 2019 dash February 1st. So here, I'm asking for everything between January 1st and February 1st. Boom, those are the files from then, I can say, till March 1st. So February 1st, March 1st. I can say from February 15th to March 10th, and we'll give me those files. And again, you can add the dash LS at the end, too, if you want more information on those files. Alternatively, we wrote out the full date, but again, it's fairly smart. If I wanted to get things that were from February 1st, I can say February 1st to March 1st. And it will give me everything from February 1st to March 1st. And again, it will default to be smart current year or previously passed. But if I want to, I can give it a year. Again, there's nothing in this file folder from 2018, because we're in my 2019 folder, so that's not going to return anything. But you could do that. It's very smart with the dates. So anyway, I hope that was awesome. I'll try to remember to put a link in the description to my scripts page, where there will be notes on Payspin on this, basically showing what we did here. But again, the man file, man find, we'll also give you this information. But there's a lot of stuff, because find can do a lot of stuff. So yeah, have fun with that. But everything I did in this video, I'll try to remember to put a link in the description of this video regarding that. Also, one last thing I'll mention. You can do this, again, with all your regular find commands. So here we go, we'll do that. So here you can see that there's a GIF or a GIF, wherever you want to say it in here, and an MP4. If I want to, I can run that same command. And I should be able to say dash name, astrid, jpeg. And now it's only going to search for jpegs. I can do dash i for case and sensitive, because I know my Canon camera puts capital JPG. So that'll be case and sensitive. So you just use this with all your regular find commands. You can also give it a directory. You know, by default, using the current directory, I can do forward slash for my root directory, or I can do the till day for home directory or dollar sign. Home search, your whole home directory. Or give it a full path to where you want to search. It's up to you for whatever your uses are. I do thank you for watching. And please visit filmsbychrist.com. That's Chris of the K. There's a link in the description there. You can search through all my videos. There's a support section that will link you to my Patreon page or a link to Paypal. If you'd like to support me that way, that would be awesome. Check out the links in the description of the video as well. And if you did like this video, think about sharing, subscribing, commenting, all that great stuff. I hope that you have a great day.