I need to find one command from multiple files and need to print that file which contains neede com


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting I need to find one command from multiple files and need to print that file which contains neede com
# 1  
Old 10-20-2009
Bug I need to find one command from multiple files and need to print that file which contains neede com

Hi all

i need your help .. I am having a multiple file in directory and i have find out the Rcopy word from these files and need to print those files which contains the Rcopy word




Thanks and regards
Vijay sahu
# 2  
Old 10-20-2009
Code:
grep -Rl Rcopy *

or

Code:
find . -type f -exec grep -l Rcopy {} \;

# 3  
Old 10-20-2009
Thank you very much
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Bash command to find a file and print contents

I need to find a file and print its contents I am trying but it is not working find -path /opt/app-root/src/.npm/_logs -type f -name "*.log" -print Version $ bash -version GNU bash, version 4.4.12(1)-release (x86_64-pc-msys) (1 Reply)
Discussion started by: SVRao19056
1 Replies

2. Shell Programming and Scripting

Read contain files find and print to new file

Hi All, Sorrry by basic question but I have many files text plane e.g. $ls file1 file2 file3 .. etc., $cat file1 123 244 345 NNN 4234 QQQ 423534 How can read contain each file and find pattern NNN and print in new file output, (2 Replies)
Discussion started by: aav1307
2 Replies

3. Shell Programming and Scripting

Compare two files and find match and print the header of the second file

Hi, I have two input files; file1 and file2. I compare them based on matched values in 1 column and print selected columns of the second file (file2). I got the result but the header was not printed. i want the header of file2 to be printed together with the result. Then i did below codes:- ... (3 Replies)
Discussion started by: redse171
3 Replies

4. Shell Programming and Scripting

Compare columns of multiple files and print those unique string from File1 in an output file.

Hi, I have multiple files that each contain one column of strings: File1: 123abc 456def 789ghi File2: 123abc 456def 891jkl File3: 234mno 123abc 456def In total I have 25 of these type of file. (5 Replies)
Discussion started by: owwow14
5 Replies

5. 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

6. UNIX for Dummies Questions & Answers

grep command to find multiple strings in multiple lines in a file.

I want to search files (basically .cc files) in /xx folder and subfolders. Those files (*.cc files) must contain #include "header.h" AND x() function. I am writing it another way to make it clear, I wanna list of *.cc files that have 'header.h' & 'x()'. They must have two strings, header.h... (2 Replies)
Discussion started by: ritikaSharma
2 Replies

7. Shell Programming and Scripting

finding multiple files using find command

I am trying to search for 2 files using the find command as below find -name file1.txt -a -name file2.txt It doesn't give a result although the files exist in the folder, however when i try the following find -name file1.txt -o -name file2.txt It does give me the result. ./file2.txt... (4 Replies)
Discussion started by: vivek_damodaran
4 Replies

8. 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

9. UNIX for Dummies Questions & Answers

find locked files, print file path, unlock file

using OS X and the Terminal, I'd like to find all locked files in a specified directory, unlock them, and print a list of those files that were unlocked how can I do this? I'm familiar with chflags nouchg for unlocking one file but not familiar with unix enough to do what I'd like. Thanks! (0 Replies)
Discussion started by: alternapop
0 Replies

10. Shell Programming and Scripting

print as well as count the files found by find command

I want the output of the find command to be printed and also the total files found by it. Can someone help in this. Obviously $ find . -type f | wc -l will not output the files found but only the count. I want both. There can be millions and trillions of files so dont want the output of find... (3 Replies)
Discussion started by: amicon007
3 Replies
Login or Register to Ask a Question