UNSORT(1)
π unsort(1) π
okay so this is unsort, from the General Commands Manual (section 1, the classics π). bestie, this little icon reorders the lines in your file in semirandom ways and honestly? it ate. let's get into it.
β¨ NAME β¨
unsort β reorder lines in a file in semirandom ways
π¦ SYNOPSIS π¦
unsort [-hvrpncmMsz0l] [--help] [--version] [--random] [--heuristic]
[--identity] [--filenames[=profile]] [--separator sep]
[--concatenate] [--merge] [--merge-random] [--seed integer]
[--zero-terminated] [--null] [--linefeed] [file ...]
πΈ DESCRIPTION πΈ
unsort prints the lines from the input files (or from standard input, if you don't name any files) in semi-random order. the vibes are shuffled but not fully chaotic, periodt.
the algorithms on offer are:
- a Mersenne Twister based PRNG (the fancy math one π₯)
- a heuristic algorithm that's out here trying to create a subjective even distribution (she wants things spread out pretty, she has a vision β¨)
π Command line options π
-h,--helpβ shows you a concise lil summary of the available options and the argument syntax. your "what do i even type" bestie π«Ά-v,--versionβ displays version and copyright info. the receipts π-r,--randomβ use the Mersenne Twister based randomization algorithm. pure PRNG energy.-p,--heuristicβ use the heuristic "shuffling" algorithm, which permutes the lines so they end up spread more or less evenly in the output. this one is the default π-n,--identityβ do not reorder the lines in the input at all. literally useful if you just want to merge the files. no shuffling, just vibes preserved π-f,--filenames[=profile]β assumes the input has a structure similar to filenames, and applies randomization separately to each directory level. this one is the main character fr fr.
an example would be a list of mp3 files where the top level is the genre, the second level is the name of the artist and the third level is the name of the album. the --filenames option lets you randomize the list with different randomization strategies for each of the artist, album and track levels. π§
two types of randomization are supported: simple and proportional.
- simple randomization picks one entry from each directory at that level in a round-robin fashion. if one directory contains fewer entries than the others, it will run out and stop appearing at some point before the end of the output. she just runs out of material, it happens π
- proportional randomization will spread the directory entries evenly over the output. balanced, gorgeous, icon behaviour.
the profile argument can be used to specify which randomization types to use. it is a concatenation of the randomization types to use for each level. use 1 for simple randomization and n for proportional randomization. if the input has more levels than specified, the last character determines the randomization type for all subsequent levels. no cap.
for example, --filenames=n1n means: use proportional randomization for the genre, use simple randomization for the artists and use proportional randomization again for the album names and all levels below that. slay π
-S,--separator sepβ the directory separator to use with-f. defaults to/. π-r,--concatenateβ concatenate all input files, then apply the shuffling algorithm to the result as a whole. one big pile, then shuffle.
not me noticing that-ris listed for both--randomand--concatenateπ that's exactly how this page reads, so I'm not touching it. iykyk.
-m,--mergeβ shuffle all input files separately, then merge the result. equal-sized files will be merged in the order in which they appear on the command line. queue up in order, besties π§-M,--merge-randomβ shuffle all input files separately, then merge the result. equal-sized files will be merged in random order. this is the default π-s,--seed integerβ use this integer as a seed, instead of random data from the environment. reproducible chaos, obsessed β¨-z,--zero-terminated,-0,--nullβ lines are terminated with a\0character. null bytes, not newlines, got it π«Ά-l,--linefeedβ lines are terminated with a\ncharacter. this is the default π
π SEE ALSO π
sort(1) β the responsible older sibling. go say hi.
and that's the whole page, bestie!! this one's from Free Software, dated 2007-11-25, and it lives under the name UNSORT(1) in section 1 of the manual. go forth and shuffle responsibly π¦πβ¨
π¦ where this page comes from
- debian bookworm: unsort 1.2.1-1+b1
- debian trixie: unsort 1.2.1-1+b2
- ubuntu jammy: unsort 1.2.1-1build1
- ubuntu noble: unsort 1.2.1-1build1
- ubuntu questing: unsort 1.2.1-1build1
- ubuntu resolute: unsort 1.3.1-1 Β· GPL-3.0-or-later
- ubuntu stonking: unsort 1.3.1-1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms