.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "PARSORT 1" .TH PARSORT 1 2024-03-22 20240222 parallel .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME parsort \- Sort (big files) in parallel .SH SYNOPSIS .IX Header "SYNOPSIS" \&\fBparsort\fR \fIoptions for sort\fR .SH DESCRIPTION .IX Header "DESCRIPTION" \&\fBparsort\fR uses GNU \fBsort\fR to sort in parallel. It works just like \&\fBsort\fR but faster on inputs with more than 1 M lines, if you have a multicore machine. .PP Hopefully these ideas will make it into GNU \fBsort\fR in the future. .SH OPTIONS .IX Header "OPTIONS" Same as \fBsort\fR. Except: .IP \fB\-\-parallel=\fR\fIN\fR 4 .IX Item "--parallel=N" Change the number of sorts run concurrently to \fIN\fR. \fIN\fR will be increased to number of files if \fBparsort\fR is given more than \fIN\fR files. .SH EXAMPLE .IX Header "EXAMPLE" Sort files: .PP .Vb 1 \& parsort *.txt > sorted.txt .Ve .PP Sort stdin (standard input) numerically: .PP .Vb 1 \& cat numbers | parsort \-n > sorted.txt .Ve .SH PERFORMANCE .IX Header "PERFORMANCE" \&\fBparsort\fR is faster on files than on stdin (standard input), because different parts of a file can be read in parallel. .PP On a 48 core machine you should see a speedup of 3x over \fBsort\fR. .SH AUTHOR .IX Header "AUTHOR" Copyright (C) 2020\-2024 Ole Tange, http://ole.tange.dk and Free Software Foundation, Inc. .SH LICENSE .IX Header "LICENSE" Copyright (C) 2012 Free Software Foundation, Inc. .PP This program is free software; you can 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 of the License, or at your option any later version. .PP 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. .PP You should have received a copy of the GNU General Public License along with this program. If not, see . .SH DEPENDENCIES .IX Header "DEPENDENCIES" \&\fBparsort\fR uses \fBsort\fR, \fBbash\fR, and \fBparallel\fR. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBsort\fR