The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to find a file named vijay in a directory using find command amirthraj_12 UNIX for Dummies Questions & Answers 6 10-25-2008 01:37 PM
doubt in tr command risshanth UNIX for Dummies Questions & Answers 2 02-25-2008 10:20 AM
Doubt in SED command gksenthilkumar UNIX for Advanced & Expert Users 1 02-19-2008 02:20 PM
doubt in cal command sumi AIX 9 03-03-2006 12:33 PM
command find returned bash: /usr/bin/find: Argument list too long yacsil Shell Programming and Scripting 1 12-15-2003 06:38 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 12-09-2005
mona's Avatar
mona mona is offline
Registered User
  
 

Join Date: Nov 2005
Location: Singapore
Posts: 96
Doubt in find command

Hi All,

I wanted to list all the files in the current directory which contains the pattern "error". I tried the following grep command

Code:
grep -i 'error' *.*
but i got the error message "ksh: /usr/bin/grep: 0403-027 The parameter list is too long."

Any idea why the grep didn't work?
Note: There are hundreds of files which contains this pattern.

I used find command to achieve the same result.

Code:
find . -type f -exec grep -i "error" {} \;
find . -type f -exec grep -i "error" /dev/null {} \;
The first command displays me the lines from all files which contains the pattern "error". But it doesn't append the filename in the front.

But the second command gave me the same result with directory name and filename appended in the beginning of each line?

Any idea why both the above find commands work differently?
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:30 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0