10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
In a directory I have two lists, all files which could contain certain fields (they all share copied code) and a list of fields. My two scripts are
<appl.list xargs grep $1
where appl.list contains files (source programs) with the fields. This script is named YY
<fields.list xargs YY
... (4 Replies)
Discussion started by: wbport
4 Replies
2. UNIX for Dummies Questions & Answers
How can I recursively find all files in a directory and print out the file and first line number of any text blocks that match the below cases?
This would seem to involve find, xargs, *grep, regex, etc.
In summary, I want to find so-called empty "try-catch blocks" that do not contain code... (0 Replies)
Discussion started by: lifechamp
0 Replies
3. Shell Programming and Scripting
Hello,
I'm interested in finding all occurrences of the terms in file1 in file2, which are both csv files. I can do this with a loop but I'm interested in knowing if I can also do it with the help of xargs and grep. What I have tried:
cat file1 | xargs grep file2
The problem is that... (15 Replies)
Discussion started by: eon
15 Replies
4. UNIX for Dummies Questions & Answers
Hi all,
I am a unix noob. Need some basic help. I have tried using google, but not able to figure this out.
Here are the scenarios:
1. How do I find a directory with a particular name, say "Merlin" in the entire file system? I tried :
find / -type d -name "dir_name"
The problem is I'm... (3 Replies)
Discussion started by: neil.k
3 Replies
5. Shell Programming and Scripting
Folks
I've been struggling this with for far too liong now and need your help!
I've been happily using grep for a search of a directory, to list the files which contain a string:
find . -type f -mtime -5 -print | xargs grep -l 'invoiceID=\"12345\"'
Now the list of 'invoiceID' I am... (4 Replies)
Discussion started by: daveaasmith
4 Replies
6. Shell Programming and Scripting
Hello there,
Let me show you a simple example of what I am trying to achieve:
1) I have an input text file with some lines:
1 a
2 b
3 c
2) And I want to run a command with these lines as arguments (+ arbitrary extra arguments). For example:
$ command "1 a" "2 b" "3 c" "bye"
I... (7 Replies)
Discussion started by: tokland
7 Replies
7. Shell Programming and Scripting
Hi,
I have a requirement to RCP the files from remote server to local server.
Also the RCP has to run in parallel. However using 'xargs' retrives 2 file names during each loop. How do we restrict to only one file name using xargs and loop till remaining files.
I use the below code for... (2 Replies)
Discussion started by: senthil3d
2 Replies
8. Shell Programming and Scripting
hi
i just want to know that how do we use xargs command to find files which are greater than specified memory
in a given directory (6 Replies)
Discussion started by: sumit the cool
6 Replies
9. UNIX for Dummies Questions & Answers
Dear all,
I have tried the following 2 lines
xargs -t -i -exec grep -i -w {} file_1 >>test < file_2
cat -s file_2| xargs -t -i -exec grep -i -w {} file_1 >> test
They were meant to search for the contents of file_2 in file_1 and write the respective lines of file_1 into file "test" .... (15 Replies)
Discussion started by: Bruno
15 Replies
10. UNIX for Dummies Questions & Answers
Hi there,
I am trying to move around 3000 files from one directory to another. The mv command is complaining from too many arguments. I tried to use the xargs command but with no luck. Could some body provide help?
Regards (4 Replies)
Discussion started by: JimJim
4 Replies