Hello everyone.
In this lecture let's talk about command find.
But before starting to show you some comments just check the mail first
it is one of the biggest Menlo because find command is a very complex and have many possibilities how
to use it.
We will cover a just few of them.
So when we want to find some file or directory we are starting with keyword.
Find
followed by starting point which is place from where the command should start searching.
So I will use directory home and now I need to specify name or file or directory which I would like
to find.
So I am using Desh name space and name of a file or directory let's say config.
We have created in last lecture after executing this command.
I see three findings.
I have three config files.
We can specify to find command what type should it search for when we specify type with parameter f
it will search only for files and when on the other hand we use Type D.
It will search for directories with the name config.
And we see that no conflict directory was found under my home directory we can find command use wildcards.
Please be Don't afraid now about it.
We will cover it lately but for now I can try to find all s h files under starting point.
Home returned
and that name asterisk dot S H represents all s h files let's say that I want to search only for files.
So we need to specify type F
so I see that I have a lot of files with ext dot s h
so let's make something more interesting with it it please note that find didn't search only in specified
directory but also in its sub directories and so on.
So now we can tell.
To find common.
To search only in starting point directory.
Using parameter Maxim then followed by number one.
This will ensure that find will search for as far as h files only inside home Richard directory and
run around it.
I can only see two files.
That means that in home Richard are only two files of an extension.
As H good I can now edit max depth parameter to number two and I see debt find common.
Found more files with max depth set to 3 which means search also in sub directories of sub directories.
I have much more findings as find.
Command is really complex.
I can search only for files which were modified more than 50 days ago using M time parameter.
So at the end I can add another parameter M time and specify plus 50 v means search also on.
Sorry search only for files.
V2 are modified more than 50 days ago and it's quite a lot.
If I change M time to only 50 without plus symbol final search for files modified 50 days ago no file
was found.
In my case and similarly when using minus symbol fine will search for files modified less than 50 days.
In my case only 3 files similar parameter S M time is a time it represents when the file was access
now let's use another other parameter for searching and it is a parameter called size.
For example let's say search inside my home directory search for files only so find 0 Richard which
is my home directory or I can use Tilde symbol to represent my home right at 3.
Search for files only that means type is F and use parameter size and search for files bigger than 5
megabytes few files in my home directory.
Var found good.
This was short summary about find command.
What can you do with it.
How to use it.
And maybe if you haven't used to find command before you might feel kind of lost as so many parameters
are there but don't be afraid.
Practice make it better and after you finish this scores and start making your own scripts you will
find the find.
Come on not so hard.
Tools.