![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| deleting specific lines from all files in a directory | vrms | UNIX for Dummies Questions & Answers | 3 | 04-25-2008 11:08 AM |
| Recursively copy only specific files from a directory tree | sharpsharkrocks | Shell Programming and Scripting | 3 | 01-07-2008 02:16 PM |
| List all files that contain a specific directory | Sat510 | SUN Solaris | 7 | 04-17-2007 10:57 AM |
| delete files in specific directory | legato | Shell Programming and Scripting | 2 | 03-29-2006 09:46 PM |
| creating object files in a specific directory | svh | High Level Programming | 1 | 02-13-2006 06:05 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
How to find a specific files in a many directory
Dear All,
Appreciate some help here. I have a log of report. It located in several directory as below: Directory: mysscpr1 mysscpr2 mysscpr3 my_scnpr4 In the directory it contain hundred of files. i need to find a specific files that contain 'invc2345' in the directory. How can i do that? without need to 'cd <directory name> ' and then use the grep command one by one in every directory such as cd <directoryname> grep invc2345 * Please assist |
|
||||
|
Dear nua,
May be my explaination is not clear: This is the sample of directory: drwxrwxr-x 3 xxxxx ulol 368640 May 28 14:24 mycrdpr1 drwxrwxr-x 3 xxxxx ulol 96 Oct 19 2007 mycrdpr2 drwxrwxr-x 3 xxxxx ulol 96 Oct 1 2007 mycrdpr3 drwxrwxr-x 3 xxxxx ulol 96 May 23 08:15 myfinpr2 drwxrwxr-x 3 xxxxx ulol 8192 Mar 1 08:26 myfinprn drwxrwx--- 2 xxxxx ulol 96 Jul 26 2007 mynpprn1 drwxrwxr-x 3 xxxxx ulol 16384 May 26 12:56 mypngpr1 drwxrwxr-x 3 xxxxx ulol 1064960 May 28 14:26 mysscpr2 drwxrwx--- 2 xxxxx ulol 96 May 15 06:00 sgisbprn1 I'm looking for an invoice number JHK8888 where it located in one of the directory and in a file under the directory. Below is the sample of file under the directory: -rw-r----- 1 1253 ulol 5386 Jul 6 2007 IBCRNtKL.abor.212113 -rw-r----- 1 1253 ulol 200070 Jul 9 2007 IBCRNtKL.abor.212941 -rw-r----- 1 chaiyeel ulol 5270 Jul 30 2007 IBCRNtKL.chel.2220 50 The problem is i also dunt know where is the file located and under which directory. I dont want to cd directory one by one and user grep to look for the invoice number. I want to make it easy. Please advice. Rgrds Shahril |
|
||||
|
Dear siba,
Please find error below: $ grep -R JHBI11117 * grep: illegal option -- R usage: grep [-E|-F] [-c|-l|-q] [-bhinsvx] -e pattern_list... [-f pattern_file...] [file...] usage: grep [-E|-F] [-c|-l|-q] [-bhinsvx] [-e pattern_list...] -f pattern_file... [file...] usage: grep [-E|-F] [-c|-l|-q] [-bhinsvx] pattern [file...] $ |
|
||||
|
Have u checked the man page for grep command?
If -R is not working then u can use -r here and try it. Quote:
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|