Operating System - HP-UX
1832214 Members
2213 Online
110041 Solutions
New Discussion

Re: search about some file ?!

 
Mousa55
Super Advisor

search about some file ?!

Hi
I want to search about some file in all file in my unix server
How I work that plz?
I am using this command " find -name AppsLocalLogin.jsp -exec -ll +"
But it is not work
Thanks and best regards
9 REPLIES 9
Pete Randall
Outstanding Contributor

Re: search about some file ?!

You need to tell the find command where to start searching:

find / -name AppsLocalLogin.jsp -exec -ll +


Pete

Pete
Mousa55
Super Advisor

Re: search about some file ?!

Hi

sorry to not write the full command i am "find / -name AppsLocalLogin.jsp -exec -ll +"
i am set the start searching but also
this command is not work
thanks
Pete Randall
Outstanding Contributor

Re: search about some file ?!

Well then you are going to have to define "not work". Do you get an error message? Do you get your command prompt back?

If you get no error message and your command prompt returns, then the file is not found. Try searching for a more generic version of the name, like "Apps*", or "[Aa]pps.[Ll]ocal[Ll]ogin.*", for example.


Pete

Pete
Sandman!
Honored Contributor

Re: search about some file ?!

You are missing the curly braces

# find / -name "AppsLocalLogin.jsp" -exec ll {} +
Sandman!
Honored Contributor

Re: search about some file ?!

You are missing curly braces and see if replacing + with \; makes a difference

# find / -name AppsLocalLogin.jsp -exec ll {} +
or
# find / -name AppsLocalLogin.jsp -exec ll {} \;
Pete Randall
Outstanding Contributor

Re: search about some file ?!

You can use the "+" command instead of curly braces, but it needs to be escape, so it should be "-exec ll \+".


Pete

Pete
Pete Randall
Outstanding Contributor

Re: search about some file ?!

Example:

#touch /home/plr/file_to_find
# find /home -name file_to_find -exec -ll \+
# find /home -name file_to_find -exec ll \+
-rw-rw-r-- 1 plr support 0 Nov 8 07:27 /home/plr/file_to_find
#


Pete

Pete
Dennis Handly
Acclaimed Contributor

Re: search about some file ?!

>Sandman: You are missing the curly braces and see if replacing + with \; makes a difference

While required by UNIX2003, {} isn't required by HP-UX. Using \; is only needed on non-supported HP-UX pre-11.00 versions.

>Pete: but it (+) needs to be escape,

No it does not. I've asked the man page be changed the last time this was brought up.


Mousa55
Super Advisor

Re: search about some file ?!

thanks for all
Nejad