Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to execute one command in multiples directories using "GNU parallel"?

Tags:

gnu-parallel

Every day I have to update a bunch of repositories and also execute in some of them another command (from CARTON, Perl module dependency manager). I use always a loop to do that but I want do it parallely with GNU parallel if it is possible but I don't understand so well its tutorial.

The point more similar I've read that can help me is called "Running the same commands on all hosts" so I got into the directory with all repos and I tried to execute: parallel --onall carton but I don't know if it works or not. Anyone can help me?

like image 222
Noob_Number_1 Avatar asked Oct 15 '14 13:10

Noob_Number_1


1 Answers

parallel 'cd {} && git pull' ::: *
parallel 'cd {} && carbon' ::: *
like image 190
Ole Tange Avatar answered Oct 05 '22 05:10

Ole Tange