Problem executing find file command in Linux


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Problem executing find file command in Linux
# 1  
Old 05-06-2009
Question Problem executing find file command in Linux

When trying to find a list of files with specific text in them using
Code:
 
find . -type f -exec grep -l "DataStage Job 4263" {}\;

I get error
Code:
 
find: missing argument to 'exec'

How can I correct this ? I'm on Linux Red Hat.
Cheers

PS I'm a DataStage programmer not a systems support bod !
# 2  
Old 05-06-2009
Needs a space character after {}

Code:
find . -type f -exec grep -l "DataStage Job 4263" {} \;

# 3  
Old 05-07-2009
Job's a good 'un ! Smilie

Thanks
# 4  
Old 05-07-2009
You can also use the pipe like follow:

Code:
 find . -type f |xargs grep -l "some text"

It could be a little faster ^^
# 5  
Old 05-07-2009
In my context it was definitely faster. Cheers.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

How to find IP of user machine executing a particular UNIX command?

Hello, Our applications are deployed in SunOS 5.10 servers. All the team members use a same username/pwd to login to the box. Very often we face issue were we could see that weblogic server instance are KILLED and we are not able to trace who executed kill command. All team members use PUTTY to... (2 Replies)
Discussion started by: santtarius
2 Replies

2. Shell Programming and Scripting

Print filename/dir name while executing aclput using find command

Running below command , but unable to print the filename , is there way to print filename/dirname using -print option find . -type f -exec aclput -i fileacl.template {} \; (5 Replies)
Discussion started by: lalitpct
5 Replies

3. UNIX for Dummies Questions & Answers

Find command not executing for copying file

Buddies, I am trying to copy the file 'xcopyq' from /home/sandip to /home/sandip/testdir using the below command and getting the error as shown below:- sandip@manu:~$ find /home/sandip -type f -name '*xcopyq*' -exec cp{} /home/sandip/testdir/ \: find: missing argument to `-exec' Am I... (2 Replies)
Discussion started by: sandip250382
2 Replies

4. Shell Programming and Scripting

Problem in executing sed command

Hi, Input: XX = to_date ('9999-12-31 23:59:59', 'YYYY-MM-DD HH24:MI:SS') Required output: XX=to_date (\'9999-12-31 23:59:59\', \'YYYY-MM-DD HH24:MI:SS\') Regards Akshu (3 Replies)
Discussion started by: akshu.agni
3 Replies

5. Shell Programming and Scripting

Problem Executing Firmware Command using Shell Script

Guys, I have a script that should change one of the configuration Parameter in a http accelerator, this config change which will halt http traffic into device. So I have designed a script which should do these changes. But after executing this script, found that one of the input variable is not... (8 Replies)
Discussion started by: raghunsi
8 Replies

6. Shell Programming and Scripting

Executing 'find' with variable as pattern problem

Hello everybody! Here is my problem: I try to write a script that searches for files with several extensions using the find utility. The file extensions are defined in a list so I build a string (variable) of the pattern arguments with these extensions but can't get find working. Here is a code... (3 Replies)
Discussion started by: Ro_land
3 Replies

7. UNIX for Dummies Questions & Answers

Problem with executing command inside a cron job

Hi All, I have scheduled a script in cron which writes output to the below file. ....>> /data/Target/wrapper_invoke_ds_job_`date '+%Y%m%d'`.ksh_out 2>&1 But the date command is not getting resolved in the format specified. It just resolves to the following. wrapper_invoke_MQ_ds_job_Tue... (3 Replies)
Discussion started by: pkm_oec
3 Replies

8. UNIX for Dummies Questions & Answers

How to find who is executing a file.

Suppose there is a file which is being executed by someone. Is there a way to return the username of whoever is using that file? (7 Replies)
Discussion started by: Sniper Pixie
7 Replies

9. UNIX for Advanced & Expert Users

problem in executing a file

All, I've a script that I'm trying to execute with crontab. But it was not working. Then when i checked executing the script manually, I've found a strange thing. the script executes only with sh <SCRIPTNAME> and not with ./<SCRIPTNAME> I'm using Red hat 7.3, and the error that i'm getting... (2 Replies)
Discussion started by: i2admin
2 Replies

10. Programming

Problem executing C files in Linux

Hi there I compiled a simple .c file using the cc command, the file was compiled successfully and executable file (a.out) was generated. But When I executed the a.out file it gave me: bash: a.out: command not found Can anybody tell me what's the problem. Note that I'm using: Red Hat... (3 Replies)
Discussion started by: HAS
3 Replies
Login or Register to Ask a Question