find a file

Thread Tools Search this Thread
# 1  
find a file

on HP-UX B.11.31 U ia64
I want to find any file containing PURGE_ARCHIVELOG , then I issued :

find . -name *PUR*.log | -exec grep "PURGE_ARCHIVELOG"
ksh: -exec:  not found

Or :

find . -name *.log | -exec grep "PURGE_ARCHIVELOG"
ksh: -exec:  not found
find: missing conjunction

Thank for help
# 2  
find . -name '*PUR*.log' -exec grep -l "PURGE_ARCHIVELOG" {} +

# 3  

find . -name "*PUR*.log" -exec grep -l PURGE_ARCHIVELOG '{}' \;

# 4  
thank you.
# 5  
find . -name "*PUR*.log" | xargs grep -l PURGE_ARCHIVELOG

# 6  
find . -type f -name "*PUR*.log | xargs grep -l PURGE_ARCHIVELOG

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Can you use find with ps or doing find excluding file in use

Hi, I am currently using the find below to remove old files. I am redirecting the listing to a file and then use a while-loop and do a rm cd ${directory} find . \( ! -name . -prune \) \( -type f -name "*.trc" -mtime +10 \) | sed 's#^./##' | sed "s#^#${directory}/#" 2>/dev/null | tee -a... (4 Replies)
Discussion started by: newbie_01
4 Replies

2. Shell Programming and Scripting

How to find a file with a specific pattern for current sysdate & upon find email the details?

I need assistance with following requirement, I am new to Unix. I want to do the following task but stuck with file creation date(sysdate) Following is the requirement I need to create a script that will read the abc/xyz/klm folder and look for *.err files for that day’s date and then send an... (4 Replies)
Discussion started by: PreetArul
4 Replies

3. Shell Programming and Scripting

wanted to find both link file and ordinary file using single find command

find . -type fl o/p is only the ordinary file. where in it wont give the link files. (2 Replies)
Discussion started by: nikhil jain
2 Replies

4. Shell Programming and Scripting

Find multiple string in one file using find command

Hi, I want find multiple string in one file using find coomand. And keeping it in one variable.grep is not working. (5 Replies)
Discussion started by: vivek1489
5 Replies

5. Shell Programming and Scripting

How to use grep & find command to find references to a particular file

Hi all , I'm new to unix I have a checked project , there exists a file called xxx.config . now my task is to find all the files in the checked out project which references to this xxx.config file. how do i use grep or find command . (2 Replies)
Discussion started by: Gangam
2 Replies

6. UNIX for Dummies Questions & Answers

CSV file:Find duplicates, save original and duplicate records in a new file

Hi Unix gurus, Maybe it is too much to ask for but please take a moment and help me out. A very humble request to you gurus. I'm new to Unix and I have started learning Unix. I have this project which is way to advanced for me. File format: CSV file File has four columns with no header... (8 Replies)
Discussion started by: arvindosu
8 Replies

7. Linux

Simplified find command to find multiple file types

Hi, I'm using the following command to find the multiple requierd file types and its working fine find . -name "*.pl" -o -name "*.pm" -o -name "*.sql" -o -name "*.so" -o -name "*.sh" -o -name "*.java" -o -name "*.class" -o -name "*.jar" -o -name "*.gz" -o -name "*.Z" -type f Though... (2 Replies)
Discussion started by: vickramshetty
2 Replies

8. UNIX for Dummies Questions & Answers

how to find a file named vijay in a directory using find command

I need to find whether there is a file named vijay is there or not in folder named "opt" .I tried "ls *|grep vijay" but it showed permission problem. so i need to use find command (6 Replies)
Discussion started by: amirthraj_12
6 Replies

9. Shell Programming and Scripting

how to find a file in UNIX without find command?

given a start directory,a filename,how to find it? (3 Replies)
Discussion started by: bluo
3 Replies

Featured Tech Videos