Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )

Advanced DNS Management
New ZoneEdit. New Managment.


Sign Up Now
Reply to this topicStart new topic
> What Is The Proper Syntax Of 'find' With -exec, unable to use -exec
post May 13 2004, 08:09 PM
Post #1

Whats this Lie-nix Thing?

Group: Members
Posts: 1
Joined: 13-May 04
Member No.: 2,947

I have been unable to figure out the proper syntax for the 'find' command with the '-exec' option. Do not have an issue with it otherwise.
the line:
find . -type f -name string* ; # returns all files beginning with 'string'
find . -type f -name string* -exec grep text {}; # should return any lines in file 'string*' with 'text' in them.

Regardless of using 2 ** 16 permutations of single quotes, double quotes, backslashes, etc.
I always get the same response:
find: missing argument to '-exec'

I have been using QNX and 'find' since 1985 and never had so much trouble (frustration) with something so simple.
I have switched to piping the 'find' results to 'xargs' to 'grep', but it is not as neat and some of the information is lost in the translation.

any working examples that I could learn the syntax from would be appreciated.
And PLEASE do NOT suggest the 'man' pages.

FYI - but totally irrelevant:
Current OS - SuSE 9.1 and 9.0 (haven't gotten around to upgrading them yet.)
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 21st June 2018 - 05:06 PM