What's the difference between {} \; and {} + or {} \+ ?
Is it possible to call multiple commands with -exec like piping:
What's wrong with using cat?
Hello cola,
Following are the answers for your queries.
Difference between {} \+and{} \;is {} \+is faster than {} \;.
Yes, it is possible to use multiple exec calls into a single findcommand, it is completely depends on your requirements.
So there is something called UUOC (Useless use of cat), so using catcommand with a command which is able to read Input_file by itself it called UUOC in very short description. Following is an example for same. Let's say we have following Input_file.
Now if want to look for string test in above Input_file then example of UUOC is as follows.
Above will read the Input_file by catcommand then it will push the standard output of this command as standard input to next grepcommand(that's why pipe|is used here) which will then read file and search for string testthen. So point here is unnecessarily we are using catwhen grepitself is capable to read Input_file from itself. So by directly using grephere to read and search Input_file we could save sometime(depending upon you Input_file size) and processes too.
Now following is the example of grepwhich is capable of reading the Input_file by itself and search a string too.
I hope this helps you.
Thanks,
R. Singh
Last edited by rbatte1; 10-03-2016 at 09:17 AM..
Reason: Converted to formatted number-list with LIST=i to give roman numerals
Hi,
I need to search for a multiple string pattern(5 key words) in a file(similar to a flat file) ,and i need to store the output in a another file .
In that file we may have mutiple occurrences of the key words.and i need only the unique.
kindly help out.
Thanks,
Mohana Krishnan (2 Replies)
Hi,
I am new to Unix world. Is there any command which can directly return the second occurance of a particular string in a file? Basically, I want to read the contents of the file from the second occurance of a particualr string. Can be implemented using a loop, but am just wondering if there... (5 Replies)
Hi ,
I have a directory structure as dir and subdirectories and files under it and so on.now I need to find the files which contain the search string under every dir and subdir and replace .
my search string is like
searchstring=/a/b
string to be replaced=/a/c/b
please help.
... (7 Replies)
Hi
i am having a group of *.csh files under parent directory. Now i want to search a particular pattern in these group of *.csh files(suppose i need to search a pattern ABC - proj ). Can anyone please tell me how to do it using find command.
Thanks in advance
sarbjit (4 Replies)
I've got a semicolon delimited file. I would like to search for fields that match a pattern, and not hardcoded eg "mth".
*th=something
If the delimited field fulfills this condition, eg. mth=value
I would like to print out both key and value for some number comparison.
eg. if value > "12"... (5 Replies)
Hi,
Need your help in this.
I have an input file that has multiple enrollment_number, somewhat like
1234567
8901234
9856321
6732187
7623465
Now i have to search and delete these enrollment_number recursively from all the files that are within multiple sub-directories of a... (10 Replies)
I am trying to search a file for a patterns ERR- in a file and return a count for each of the error reported
Input file is a free flowing file without any format
example of output
ERR-00001=5
....
ERR-01010=10
.....
ERR-99999=10 (4 Replies)
i have a file named keyword.csv(contains around 8k records) which contains a no. of columns.
The 5th column contains all the keywords.
I want to recursively search these keywords in all .pl files(around 1k) and display the filename....Afterthat i will use the filename and some of the column from... (3 Replies)
Hi All,
I hope somebody would be able to help me.
I would need to search a string coming from a file, example file.txt:
dog
cat
goat
horse
fish
For every string, I would need to know if there are any files inside a directory(recursively) that contains the string regardless of case.... (9 Replies)
Experts,
Need your support for this awk script.
we have only one input file, all these column 1 and column 2 are in same file and have to do lookup for values in one file(column1 and column2) but output we need in another file
Need to grep row whose string contains 9K from column 1. When found... (6 Replies)