Reputation: 925
For the following command:
docker ps -a -q | xargs -r docker kill
I get this error:
xargs: illegal option -- r
What would be the MacOS equivalent of the above command?
Upvotes: 9
Views: 11758
Reputation:
The equivalent is simply docker ps -a -q | xargs docker kill
.
-r
(aka. --no-run-if-empty
) is only necessary on GNU xargs because it will always run the command at least once by default, even if there is no input; -r
disables this. BSD xargs does not have this behavior, so there's no need to disable it.
Upvotes: 12