shuf
Shuf is a command-line utility in Unix-like operating systems, including Linux and macOS, used for generating random permutations of input lines. It is part of the GNU core utilities package and is often used for shuffling data, creating random samples, or generating random numbers. The name "shuf" is a contraction of "shuffle".
Shuf can read input from standard input, a file, or a range of numbers. When used with
The basic syntax for using shuf is:
-e, --echo: Treat each argument as an input line.
-i, --input-range=LO-HI: Treat each number LO through HI as an input line.
-n, --head-count=COUNT: Output at most COUNT lines.
-o, --output=FILE: Write result to FILE instead of standard output.
Shuf is particularly useful for tasks such as creating randomized test data, shuffling a list of names,