RANDOMIZE(1)

NAME
randomize - randomize lines from a file or from stdin

SYNOPSIS
randomize [-h(elp)] [-0/-z(ero_terminated)] [file...]

DESCRIPTION
randomize prints out the lines of one or more files in random order. If no file is specified, lines are taken from stdin.

OPTIONS

-h  Print help and quit.

-0  Assume that lines are separated with NULL characters instead of EOL characters. This is intended to work with the -print0 option of find and/or the -0/--null option of xargs.

-z  Synonym for the -0 option.

NOTES
The number and length of lines is limited by system memory. The entire contents of all lines to be randomized must fit into memory at once. A program called shuf was added to the GNU coreutils 6.0 in 2006. It operates very similarly to randomize. Also, version 6.1 of coreutils added the -R option to sort to make it provide randomized output. If you are trying to write highly portable shell scripts, you might consider using shuf or sort -R instead.

COPYRIGHT
Copyright (C) 2004-2026 by Brian Lindholm. This program is free software; you can use it, redistribute it, and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.