About 50 results
Open links in new tab
  1. When is xargs needed? - Unix & Linux Stack Exchange

    The xargs command always confuses me. Is there a general rule for it? Consider the two examples below: $ \\ls | grep Cases | less prints the files that match 'Cases', but changing the command to t...

  2. xargs -I option - Unix & Linux Stack Exchange

    May 11, 2016 · The -0 option in your example instructs xargs to split its input on null bytes instead of blanks or newlines. Combined with find 's -print0, this allows filenames containing blanks or newlines …

  3. Using xargs with input from a file - Unix & Linux Stack Exchange

    17 $ man xargs ... --arg-file=file -a file Read items from file instead of standard input. If you use this option, stdin remains unchanged when commands are run. Other- wise, stdin is redirected from …

  4. xargs -0 cmd vs find . -exec cmd - Unix & Linux Stack Exchange

    Jan 7, 2023 · With find . -print0 | xargs -0 cmd, cmd can do a exit 255 to abort xargs, but find won't exit afterwards until it tries to write the next block to the pipe. xargs -0 cmd over -exec cmd {} + The main …

  5. Piping commands after a piped xargs - Unix & Linux Stack Exchange

    Jun 12, 2015 · The xargs -I {} will take the ' {}' characters from the standard input and replace them with whatever comes in from the pipe. This means you could actually replace {} with any character …

  6. How can I find files and then use xargs to move them?

    I would also like to suggest some alternate tools. Of course find has been around for a very long time so it is a robust tool but I found fd to be a lot easier to work with: fd -d1 -epdf -S+2m -x mv {} books/ This …

  7. bash - xargs: run a command for each line and separate arguments …

    Apr 4, 2023 · To answer the: xargs: run a command for each line and separate arguments with whitespace? in the subject, that's exactly what the -L ¹ option is for. xargs -L1 cmd << 'EOF' 1 2 3 …

  8. bash - xargs treat multiple lines as arguments to single command ...

    Dec 8, 2022 · The question is titled "xargs treat multiple lines as arguments to single command invocation", so let's consider your answer in that context. First of all, using paste in this way destroys …

  9. Make xargs pass as first parameter - Unix & Linux Stack Exchange

    I'm trying to produce this behaviour: grep 192.168.1 *.txt By passing a string into grep via Xargs but it is going on the end instead of as the first parameter. echo 192.168.1 | xargs grep *.txt I

  10. bash - Copy multiple files using command `xargs` - Unix & Linux Stack ...

    Mar 28, 2018 · Copy multiple files using command `xargs` Ask Question Asked 7 years, 9 months ago Modified 7 years, 9 months ago