VNL-SORT(1)
π VNL-SORT(1) π
okay bestie, welcome to the vnlog manual, and specifically to vnl-sort β the little icon that sorts an vnlog file and keeps the legend while doing it. no cap, that's the whole point. π
β¨ NAME β¨
vnl-sort β sorts an vnlog file, preserving the legend π¦
πΈ SYNOPSIS πΈ
let's look at a vibe check first. here's our lil test file:
$ cat a.vnl
# a b
AA 11
bb 12
CC 13
dd 14
dd 123
Sort lexically by a:
$ <a.vnl vnl-sort -k a
# a b
AA 11
CC 13
bb 12
dd 123
dd 14
Sort lexically by a, ignoring case:
$ <a.vnl vnl-sort -k a --ignore-case
# a b
AA 11
bb 12
CC 13
dd 123
dd 14
Sort lexically by a, then numerically by b:
$ <a.vnl vnl-sort -k a -k b.n
# a b
AA 11
CC 13
bb 12
dd 14
dd 123
Sort lexically by a, then numerically by b in reverse:
$ <a.vnl vnl-sort -k a -k b.nr
# a b
AA 11
CC 13
bb 12
dd 123
dd 14
Sort by month and then day:
$ cat dat.vnl
# month day
March 5
Jan 2
Feb 1
March 30
Jan 21
$ <dat.vnl vnl-sort -k month.M -k day.n
# month day
Jan 2
Jan 21
Feb 1
March 5
March 30
π DESCRIPTION π
Usage: vnl-sort [options] logfile logfile logfile ... < logfile
so basically: this tool sorts given vnlog files in various ways. it's a wrapper around the GNU coreutils sort tool, and because it's a wrapper, most commandline options and behaviors of sort are present β go consult the sort(1) manpage for detail, iykyk.
here's the tea on how it's different from GNU coreutils sort:
- the input and output to this tool are vnlog files, complete with a legend. periodt.
- the columns are referenced by name, not index. so instead of saying
sort -k1
to sort by the first column, you say
sort -k time
to sort by column "time". iconic, honestly.
- the fancy
"KEYDEF"spec fromsortis only partially supported. only full fields are allowed here, so the start/stop positions don't make sense. the"OPTS"are supported though β those change the type of sorting in a given particular column. for instance, to sort by month and then by day, do this (see example above):
vnl-sort -k month.M -k day.n
--files0-fromis not supported due to lack of time π. if somebody really needs it, talk to me.--outputis not supported due to an uninteresting technical limitation. the output always goes to standard out.--field-separatoris not supported because vnlog assumes whitespace-separated fields.--zero-terminatedis not supported because vnlog assumes newline-separated records.- by default the
"sort"tool gets called to do the actual work. if the underlying tool has a different name or lives in an odd path, you can specify it by passing--vnl-tool TOOL.
past all that, everything sort does is supported, so go read that man page for detailed documentation. π
heads up bestie: all non-legend comments are stripped out, since it's not obvious where they should end up. don't come for me. π
π«Ά COMPATIBILITY π«Ά
I use GNU/Linux-based systems exclusively, but everything has been tested functional on FreeBSD and OSX in addition to Debian, Ubuntu and CentOS. I can imagine there's something I missed when testing on non-Linux systems, so please let me know if you find any issues. π
π₯ SEE ALSO π₯
π REPOSITORY π
https://github.com/dkogan/vnlog/
π AUTHOR π
Dima Kogan "<dima@secretsauce.net>"
β LICENSE AND COPYRIGHT β
Copyright 2018 Dima Kogan "<dima@secretsauce.net>"
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
and that's the whole page, bestie π this one's from the vnlog manual, dated 2026-01-26 β go sort something slayfully, and remember: legend stays, comments go β¨π¦π
π¦ where this page comes from
- ubuntu resolute: vnlog 1.42-1 Β· LGPL-2.1-or-later
- ubuntu stonking: vnlog 1.42-1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms