6

I have seen examples on the web of xargs with the argument -r0. What does this argument mean? My man pages don't show any entries for -r0 nor do most man pages I have seen (e.g. http://linux.die.net/man/1/xargs)

9

-r0 is two flags. It is -r and it is -0.

From the xargs(1) manpage:

-r
If the standard input does not contain any nonblanks, do not run the command. Normally, the command is run once even if there is no input. This option is a GNU extension.

-0
Input items are terminated by a null character instead of by whitespace, and the quotes and backslash are not special (every character is taken literally). Disables the end of file string, which is treated like any other argument. Useful when input items might contain white space, quote marks, or backslashes. The GNU find -print0 option produces input suitable for this mode.

  • 2
    I missed it too. Duh it's 2 switches. I didn't even think of that, thanks Evan! – slm Jul 20 '13 at 0:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.