shuf is a utility that outputs a random permutation of its input lines.
It is an ISC licensed reimplementation of the shuf(1) utility from GNU
coreutils.
shuf [-hv] [-n count] [-o outfile] [-rz] [file]
shuf [-hv] -e [-n count] [-o outfile] [-rz] [args ...]
shuf [-hv] -i lo-hi [-n count] [-o outfile] [-rz]
See shuf.1 for more details.
Because of its use of OpenBSD
arc4random_uniform(3),
getprogname(3),
reallocarray(3), and
strtonum(3),
non-*BSD users may need to install
libbsd to compile shuf.
configure will figure this out for you.
./configure
$ make
$ sudo make install
Patches always welcome.
shuf should not crash on any input. shuf has been extensively fuzzed with
afl-fuzz but more testing is always
better. Please file a bug report with crashing input if you find any.
shuf should perfectly mimic GNU shuf behavior, with minimal exceptions.
Two notable exceptions are better error messages and more strict getopt
handling. If you discover any areas where shuf does not mimic GNU shuf,
please file a bug report.
ISC license. See LICENSE for details.
Tarballs are available under the Releases tab. Please use the versioned tarball instead of the auto-generated tarballs.
Source code is hosted on GitHub: https://github.com/ibara/shuf