thinkhk 发表于 2018-11-3 08:18:03

通过xargs实现redis cluster批量keys操作

This manual page documents the GNU version of xargs.xargs reads items from the standard input, delimited by blanks (which can beprotected with double or single quotes or a backslash) or newlines, and executes the command (default is /bin/echo) one or more times with any initial-arguments followed by items read from standard input.Blank lines on the standard input are ignored.  The command line for command is built up until it reaches a system-defined limit (unless the -n and -L options are used).The specified com‐mandwill be invoked as many times as necessary to use up the list of input items.In general, there will be many fewer invocations of com‐mand than there were items in the input.This will normally have significant performance benefits.Some commands can usefullybeexecuted in parallel too; see the -P option.
  BecauseUnix filenames can contain blanks and newlines, this default behaviour is often problematic; filenames containing blanks and/or new‐lines are incorrectly processed by xargs.In these situations it is better to use the -0 option, which prevents such problems.   Whenusing thisoptionyou will need to ensure that the program which produces the input for xargs also uses a null character as a separator.If that program is GNU find for example, the -print0 option does this for you.
  If any invocation of the command exits with a status of 255, xargs will stop immediately without reading any further input.An error message is issued on stderr when this happens.

页: [1]
查看完整版本: 通过xargs实现redis cluster批量keys操作