Skip to main content
Filter by
Sorted by
Tagged with
3 votes
5 answers
188 views

I want to produce this output: 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 For that I created this script: (Based on https://stackoverflow.com/a/23961301/22133250) ...
Signor Pizza's user avatar
-3 votes
1 answer
163 views

I am updating an existing pipeline on GitLab that creates an automatic cascade on GitLab. When a merge request is merged, the pipeline is triggered to perform an automatic commit to a lower branch (if ...
Oupat's user avatar
  • 131
1 vote
1 answer
36 views

echo -e "a b \nc d"|xargs -L1 a b c d echo -e "a b\nc d"|xargs -L1 a b c d see the above code. The man page says that "-Lmax-line means Use at most max-lines nonblank input ...
alexis's user avatar
  • 13
1 vote
1 answer
70 views

I need to grab the exit status from a command that I run via xargs. Since that's not possible it's recommended to use parallel. Some documentation suggests that it's often as simple as swapping the ...
James Rowell's user avatar
0 votes
2 answers
75 views

I'm trying to write a makefile target using xargs, but the implementation is a bit over my head. Here's the what I would like: dryrun: @mkdir -p $(OUTPUT_DIR) @if test -e $(MY_DIST); then \ ...
Matt Heidelbaugh's user avatar
-2 votes
1 answer
98 views

Command 1: lsusb | awk '{print $6}' Output 1: 1d6b:0002 0627:0001 0627:0001 0627:0001 0409:55aa 46f4:0001 1d6b:0003 1d6b:0002 1d6b:0003 Command 2: lsusb | awk '{print $6}' | xargs Output 2: 1d6b:...
Folkert Meeuw's user avatar
1 vote
0 answers
106 views

The output of the command chain provides a list of all the parameters of the modules. I have executed the command chain in bash under fedora 40. The first command to show the Linux OS release: cat /...
Folkert Meeuw's user avatar
0 votes
1 answer
64 views

I have a dir in which I keep adding new dirs from a script. I want to enter that new sub-dir directly rather that always manually doing eza --sort=modified then copy pasting that name then cd into ...
bbqman's user avatar
  • 41
0 votes
1 answer
55 views

I'm referring to the following command from the book "Linux shell scripting cookbook". find . -name '*.txt' | xargs -I ^ sh -c "echo -ne '\n ^: '; grep arg ^" And have the ...
Ames ISU's user avatar
  • 417
0 votes
2 answers
134 views

I need to create sub-folders under in selected_images with identical structure as download_async/. I used this command: ls download_resave/ | xargs -n1 -t -I{} mkdir -p select_images/{} But I know ...
coin cheung's user avatar
  • 1,147
-1 votes
4 answers
151 views

I have a tab-separated-file myfile.tsv of form: "a" "b" "c" "d" How can I process it with xargs (i.e. what args I need to pass) to pass these fields ...
Vadim Kantorov's user avatar
0 votes
3 answers
82 views

I want to pipe plocate output (a list of paths) to another command using xargs. I need to use the -I{} replacement but I want to run one single command with all args, not one command per arg. The ...
nadapez's user avatar
  • 2,719
0 votes
1 answer
87 views

Not sure why I can't find this answer anywhere. Input CSV: 201800001779830000,"17798320181.pdf",,,159.0,5371.0,,,,,,2019,"{}",2022-08-25 12:58:20.928,2022-08-26 03:13:35.292,...
diyer0001's user avatar
  • 153
0 votes
1 answer
67 views

I am using the solution @Krzysztof proposes in Restarting an unhealthy docker container based on healthcheck. I have made one change to the original, adding --verbose so that the command docker ...
user594102's user avatar
0 votes
3 answers
69 views

Is it possible to determine the number of times a particular word appears in multiple files - file by file - using grep the "-c" option but this returns the number of matching lines the ...
IUnknown's user avatar
  • 10k
0 votes
1 answer
143 views

From the first API call, a JSON response is returned which includes a bunch of links. I want to curl each link, and download the file to a location based on the last 3 path segments. For example, if ...
qwr's user avatar
  • 11.6k
3 votes
2 answers
195 views

I'm trying to calculate the size of an rsync backup before executing it: du -hs -- $(rsync -avn --exclude --delete $source $target | grep / | grep -v " bytes/sec" | grep -v "deleting &...
rumpel's user avatar
  • 83
0 votes
3 answers
143 views

I want execute a command where I have the args as single string but they need to be in a custom position. E.g. in the following example I want the args to be positioned before any fixed args that I ...
David Nguyen's user avatar
0 votes
0 answers
62 views

I use WSL for development. When I start Visual Studio Code and connect it to an Ubuntu 22.04 WSL instance, I always get this error when launching VS's Terminal: xargs: unmatched double quote; by ...
dmbabu's user avatar
  • 1
0 votes
1 answer
116 views

I have a repo with a lot of submodules, and it takes a long time to initialise all of them from a fresh checkout. git submodule update --init seems to do everything in series, when the operation ...
hwjp's user avatar
  • 16.3k
0 votes
1 answer
64 views

I have a long list of symbolic links to python venvs that I would like to run the --version flag on. Some of the links are broken and some of the Python binaries require other versions of glibc than ...
OldManWaterfall's user avatar
0 votes
2 answers
323 views

I am running a larger copy job online. I am using tar for that piped to xargs. My command looks like this: tar cvf - --sort=name --ignore-failed-read -C /pathto/source . | pv | xargs -n 1 -P 32 $(tar ...
t.mas's user avatar
  • 1
0 votes
0 answers
115 views

I have a use case, where we need to move large files from openshift to another server. Each files are in GBs. Total size of files were few Terabytes. I'm using oc rsync/cp feature to move files.But it'...
Cdr's user avatar
  • 591
0 votes
1 answer
112 views

I wasn't able to find an answer for this simple question. I had a solution for it years ago and I think it involved something like { }, but I've totally forgotten now. I'm looking to grep for a ...
jktstance's user avatar
  • 165
1 vote
1 answer
322 views

If I want to find only first match of command grep I use this: find -name "*.jar" | xargs grep -al myText | head -1 And it's work just fine. But it's also show the next message: xargs: grep:...
Alexei's user avatar
  • 16k
0 votes
4 answers
88 views

Noob question! I've got a function on the command line that takes parameters sqr() { echo $(( $1 * $1 )) ; } sqr 4 echos 16. fine. Now I want to pipe an output to this function echo 4 | sqr I get &...
Mark Giddens's user avatar
0 votes
1 answer
54 views

I am contemplating about some nuances of xargs. Reading the question: ( what is the difference between -L and -n in xargs ) I feel irritated. When I use a multiple argument command sh -c "...&...
thilo's user avatar
  • 327
0 votes
4 answers
132 views

I have file names like this: /foo/bar/bazz/JMA01023D_E07/JMA01023D_E07_EKDL230054768-1A_22HFKNLT3_L4_1.fq.gz /foo/bar/bazz/JMA01023D_E08/JMA01023D_E08_EKDL230054768-1A_22HFKNLT3_L4_1.fq.gz /foo/bar/...
TravelingFox's user avatar
0 votes
0 answers
114 views

I have referred to quite a few answers on SO but haven't been able to figure out a solution for this. What I am trying to do is to have a cd command that uses fzf to match the directory to jump into. ...
Akshay Sehgal's user avatar
1 vote
2 answers
310 views

I'm running into strange behavior with xargs in a bash script where the replacement is not working anymore when placing it in the middle of a variable with special characters. Please see the following:...
PressingOnAlways's user avatar
0 votes
2 answers
150 views

docker ps -f health=unhealthy --format "docker restart {{.ID}}" | xargs --no-run-if-empty -t docker restart output is : docker restart docker restart 7c20974e2b02 7c20974e2b02 Error ...
Vincent's user avatar
  • 25
0 votes
2 answers
642 views

Sometimes it's useful to write an xargs command that begins with xargs -I {} 'echo {} | [rest of command]' in order to redirect the argument as a pipe. however, for large arguments, you will ...
tuskiomi's user avatar
  • 198
1 vote
2 answers
78 views

I have a bash script like the following example that attempts to first list a bunch of items, then run a command on those items individually: customListCommand | xargs -P 10 -n1 echo If ...
Ymi's user avatar
  • 808
1 vote
1 answer
36 views

I'm running a bash script that greps through files to identify tests, then it should output the results to a string and store in a variable. When the command is run on its own it echoes out all the ...
LoneWolfPR's user avatar
  • 4,121
0 votes
0 answers
133 views

I'm looking for the most versatile/easiest way to run an embarrassingly parallel code with changing inputs. I want the final solution to be able to run on a workstation (no PBS available), but also ...
js1's user avatar
  • 3
0 votes
3 answers
225 views

I have a directory called windows which contains files with names containing spaces. I want to replace the spaces in file names with underscores _. I need to correct all file names in the windows ...
sauvy's user avatar
  • 1
1 vote
1 answer
119 views

I have an awk script that processes files passed in. It runs on one input file and redirects into one output file... awk -f solar.awk ./PerformanceData_2023-08-02_02-02-17/tmp_YdayData.txt > output....
MaxG's user avatar
  • 227
0 votes
2 answers
101 views

Bash 3.2.57 running on OSX. Following displays the function definition as expected. declare -f my_bash_function Following works as well but only with -v flag. bash -vc "$(declare -f ...
Hado99's user avatar
  • 557
2 votes
2 answers
675 views

I would like to use xargs to run a command on a number of files where the output from the command has a different file extension. For the example below I am using echo as a dummy command. ls *.las | ...
kungphil's user avatar
  • 1,859
4 votes
2 answers
106 views

I am writing a backup script in bash and want to delete all backups older than X days, while leaving at least the newest N backups. This seems so simple, yet I have not been able to find a solution to ...
smatberg_gpe's user avatar
1 vote
3 answers
98 views

The following executes do_x.sh on all files of type a_???.json recursively. However, I would like to do the same on a subset of these files that do not have a corresponding file with the same name and ...
Tims's user avatar
  • 651
2 votes
2 answers
133 views

A colleague of mine wanted to run a FORTRAN program that takes files arguments and outputs their ordering (best first) against some biophysicochemical criterion. What he needed were the 10 best ...
Fravadona's user avatar
  • 17.7k
-2 votes
1 answer
230 views

How to solve issue Argument list too long in grep command? I need to execute grep command grep '^ORA' '/log/bssuser/CDR/Postpaid_CDR_Log/'*.log > output.txt I have error : -bash: /usr/bin/xargs: ...
Amany Abd Elmnem's user avatar
0 votes
2 answers
115 views

I'm trying to write a script that requires to export some env variables by reading the values and names from an .env file. Here's an example of the .env file: INSTANCE_PROFILE_ARN=arn:aws:iam::...
Sergio Flores's user avatar
0 votes
1 answer
213 views

I have the following command: fd --type f -0 --full-path $HOME/something/something_inside_something | fzf --read0 --print0 --exit-0 --preview 'bat {1}' | xargs -r -0 vim Where vim is an alias of: ...
Vikare's user avatar
  • 23
1 vote
1 answer
128 views

I realized that somehow after a while my team and i collected ~80 stale branches in one repo. The history should be kept. So I thought just tag every branch with a prefix "archive/". But i ...
Tollpatsch's user avatar
0 votes
1 answer
93 views

I have saved a list of file paths to a text file and unfortunately the leading '/' gets dropped in the process from each path turning the file path from an absolute to a relative one. I am using <...
ScottyCov's user avatar
0 votes
0 answers
166 views

when I was finishing the c6.s081(2021) lab1 xargs, I found a function from other person which is below: #include "kernel/types.h" #include "kernel/param.h" #include "user/user....
songcao liu's user avatar
7 votes
1 answer
5k views

I have an xargs command in a bash script. The script runs, but this warning is returned xargs: warning: options --max-args and --replace/-I/-i are mutually exclusive, ignoring previous --max-args ...
bteamnz's user avatar
  • 71
0 votes
1 answer
64 views

I am creating a bash pipeline where I want to find files that contain specific text and then do something with only those files. I can successfully get the list of files using the find/xargs pairing: ...
Paul Waldo's user avatar
  • 1,273

1
2 3 4 5
27