utility in Unix-like operating systems for passing large numbers of arguments to programs that can only take a small number of arguments

learn more… | top users | synonyms

0
votes
4answers
382 views

How do I execute find with GNU xargs to traverse a set of directories?

$ echo {a,b,c}.h d e.h |xargs -IA find A -name '*.h' find: `a.h b.h c.h d e.h': No such file or directory $ echo -e a.h\\nb.h c.h d e.h |xargs -IA find A -name '*.h' a.h find: `b.h c.h d e.h': No such ...
1
vote
3answers
138 views

add new line after every end of file's contents while merging multiple files

I have written shell script to merge different file's contents I have created directories f1,f2,d1,d2 and files under them , I need to merge all files's contents : comand is (find /home/ah5024331/f1 ...
1
vote
2answers
39 views

Pass all *.txt files to a Python script in parallel

I have a Python script that takes a .txt file and does something with it. I need a Linux shell command that will search for .txt files throughout the system and pass the .txt files to my Python ...
1
vote
2answers
34 views

Retrying failed command that is run with xargs

I have a script that rsync's files over in parallel using xargs and rsync daemon mode. I occasionally get errors with rsync due to writes happening on the source. I want to be able to retry the rsync ...
1
vote
2answers
1k views

Remove all except one file and directory at path

I need to remove all the files in a directory except for one file and one folder. Up to the grep I can output the correct list of items I want to remove but when i add xags, nothing is deleted. this ...
0
votes
2answers
56 views

remove pattern with random numbers (digits) from php files

I am trying to remove or replace the digits ((random numbers)) in big numbers of php files using find & xargs and grep with sed etc .. the numbers looks like that inside the php file ...
0
votes
2answers
109 views

find/xargs, filenames with spaces, and quotes

I'm looking for a way to get find and xargs (GNUWin32, under Win7, both programs at version 4.1) to play along, with filenames that contain spaces. Getting the filenames into xargs as one was one ...
0
votes
2answers
182 views

xargs + pv = messed up terminal

if i want a little progress indicator on my long-running operation i can use pipeviewer: ssh pc2 cat some.file | pv -nC reading | gzip --fast | pv zipping > some.file.gz this gives me a fun ...
1
vote
1answer
34 views

xargs misinterprets backslashes on windows

I am using gnuwin32 utilities on windows 7. I want to pipe a file list to xargs to remove the files. but if i pipe normal windows paths in then xargs interprets and removes the backslashes dir /B ...
1
vote
1answer
60 views

xargs process string as multiple arguments

Linux GNU xargs I have the file doit with arg1 arg2 arg3 arg4 arg1 arg2 arg3 arg4 I want to perform command arg1 arg2 arg3 arg4 command arg2 arg2 arg3 arg4 What I can't figure out is how to ...
1
vote
1answer
390 views

xargs in shell script

I want to group jpeg images by odd number and even number. So I did like following: $ mkdir odd $ mkdir even $ find . -regextype posix-egrep -regex ".*[13579].jpg$" -print0 | xargs -i -0 mv {} odd/ $ ...
0
votes
1answer
636 views

Find & du to calculate total size vs xargs

Can someone confirm that the following one liner will produce the total human readable size of all the directories which FIND locates as having log in the name? find -type d -name *log* | du -hcs
0
votes
1answer
283 views

Control mplayer ran by xargs

I feed mplayer with file list from another command: beet ls somequery -p | xargs -d '\n' mplayer When invoked this way, mplayer doesn't react on any standard keys, all I can do is to C-c interrupt ...
1
vote
0answers
40 views

fswatch does not pass arguments to xargs

I'm starting using fswatch on os x. I've read tutorial, but example from there does not work for some reason. I'm executing fswatch /$HOME/Projects/utils/configs/.vimrc | xargs -0 -n 1 -I {} echo {} ...
1
vote
0answers
167 views

How can I use xargs replace but keep space delimiter?

Consider the following xargs usage: echo Alice Bob Carol | xargs -n1 echo It produces three echo statements like this echo Alice echo Bob echo Carol Consider this modified xargs usage: echo ...
0
votes
0answers
29 views

How can I get xargs -I to work with large strings

Here's a contrived usage of xargs that I'm running on Mac OS X: $ head -c 128 /dev/urandom | openssl base64 -A | xargs -I {} echo {} ...