Skip to main content

Questions tagged [xargs]

xargs is a command that executes another command and generates its arguments from stdin

5 votes
2 answers
482 views

"xargs -I {}" not replacing with input string, says "/usr/bin/xargs: {}: No such file or directory"

I am encountering difficulty with xargs -I {} , which is not replacing with input string , saying "/usr/bin/xargs: {}: No such file or directory" For example , I have tried : /usr/bin/which -...
amphibole's user avatar
-2 votes
1 answer
140 views

sed inplace in selective block

I have a dir containing logstash config files these files have filter blocks, and sometimes nested child blocks need to match whole filter block filter { any text till final matching closing brace for ...
Sollosa's user avatar
  • 2,009
-1 votes
3 answers
151 views

zgrep - Find an IP address in 1200 *.gz files

I want to find out in which of my 1200 *.gz files a certain IP address occurs on a certain date (17.07.2025). I could not find the IP address in my current logs: grep 'IP address' *.logs My attempt ...
fl1tz's user avatar
  • 1
1 vote
1 answer
99 views

Process some Folders and format the output

In Linux there are some Folders. I want to process each of this Folders with the program myprogramm. I get a list with ls -1 or much better, sure only Folders with: find . -maxdepth 1 -type d -printf '...
Banana's user avatar
  • 241
0 votes
1 answer
81 views

Run md5sum parallel with a Spinner or Progressbar

In Linux in a Folder there are some files (no Sub-Folders). I will create with md5sum MD5-Checksums from all these files and write it in ../md5sum. The Files are stored on an SSD and the System has ...
Banana's user avatar
  • 241
2 votes
3 answers
408 views

Create Subfolders for files and move them into, each for themselves

In Linux in a Folder there are these files: LQ0gfKQej7GKG44Cn0sSAC.part01.rar LQ0gfKQej7GKG44Cn0sSAC.part02.rar LQ0gfKQej7GKG44Cn0sSAC.part03.rar LQ0gfKQej7GKG44Cn0sSAC.part04.rar ...
Banana's user avatar
  • 241
0 votes
2 answers
87 views

One-liner piping from find/xargs with paths including spaces

The following question likely does not relate specifically to Vim. I use a Vim example, as this is where I encounter the issue. Working on Ubuntu, I often open multiple files in Vim using tab pages: $ ...
user7543's user avatar
  • 266
9 votes
5 answers
1k views

Run command on each line of CSV file, using fields in different places of the command

I have a CSV file and want to run a command for each line, using the fields of the file as separate arguments. For example given the following file: foo,42,red bar,13,blue baz,27,green I want to run ...
luator's user avatar
  • 312
0 votes
1 answer
102 views

How to batch compress pdfs?

I'm looking to batch compress some pdfs, using the convert to/from ps trick outlined elsewhere. I have a function defined in an .zshrc file: function pdfcompress() { for f in "$1"; do ...
sporkl's user avatar
  • 103
0 votes
2 answers
105 views

Using find with vim for file that contains whitespace

I have a file which contains whitespace in its name: my file.txt. If I want to find a file which has this name and pipe its output to a vim with args, I must use --null|-0 in order to handle ...
glacier's user avatar
  • 491
0 votes
3 answers
120 views

Expect script with Xargs and multiple parameters

I have an expect script that will SSH into a list of routers. The expect script works on a list of routers in a file and is called from a bash script with xargs. Bash : script get-rtr.sh #!/bin/bash /...
Roger McCarrick's user avatar
0 votes
2 answers
136 views

Run program only on matching lines

Let's say I have a program blackbox, and a file with the following contents: in this file this line contains =TAG= so does =TAG= this one as =TAG= does this other line this line does ...
wobtax's user avatar
  • 1,175
2 votes
1 answer
169 views

cp 'same file' error when using -L with find and xarg

I'm trying to replace symlinks in my current directory with the files they point to. I thought I understood 'cp' and the '-L' argument, but apparently not. Here's the command I am using find ./ -...
mikemtnbikes's user avatar
0 votes
2 answers
99 views

How to print the processed argument after each command invocation with xargs

i run this command: ls -1 | xargs -I% -n1 -P8 myprogramm -s1 -r5 -q -o %.dat % it works with 8 runs at one time, the -q switch in myprogramm for quit, that is ok so. but i will add something like ...
user447274's user avatar
4 votes
5 answers
901 views

how to process a sequence of items N at a time

I want to run a command N times in parallel using bash and xargs on a Linux system. The command is: for i in `seq 1 $(howmany.txt)`; do aprogramm --file file$i.dat ; done The file howmany.txt ...
user447274's user avatar

15 30 50 per page
1
2 3 4 5
48