Shell Script


New Member
Nov 14, 2020
Reaction score
I need to create a variable script that uses the "find" utility to search the home directory for files. Example; (./ data) The search also needs to be case-insensitive. The results should look like what is in the attachment.


  • Capture6.PNG
    38.7 KB · Views: 421

This looks like a homework assignment.

"find" will .. ummm... find files.

find / -name

The "/" is where the search starts from, so if you know the file is somewhere under /home, you could do something like...

find /home -name

the -name flag tells it to match the name exactly.
If you use -iname instead, it becomes case insensitive.

There are other flags such as how many directories deep you want to search,
Do you want to list symbolic links or not?

There are flags for newer files, so that if it finds the same file name more than once
it will show you which is the newest.
You can find files, symbolic links, directories, even sockets.

Most of this can be found out by reading the man pages.

man find

name of file will be

well i guess the common element is /home/user/

so start from home
cd ~
echo $(pwd)
ls -l | find -type f

//along those lines geany is quite good for playing with code and running !

Members online