Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hello,

My file is located in unix env.
I am in the home dir of unix and now i want to search my file.

How to search a file (xyz.h)in UNIX dir / sub dirs from home dir?

Thanks in advance.
Posted

locate will work (and quickly) if your system has updated its database since you created the file.

find will always work because it searches the filesystem:

find / -name xyz.h -ls


And ack[^] is a very handy utility for searching for strings in files.
 
Share this answer
 
I guess
find / | grep xyz.h

will do the job.
:)
 
Share this answer
 
You can also use locate[^] instead of find
locate xyz.h
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900