Skip to Content
gnux

gnux

The GNU core utilities in one cross-platform binary, a Go library, and a portable shell.

gnux brings the interface of the GNU core utilities to every platform: one binary of GNU-compatible tools, written in Go. Every tool is named after its GNU counterpart with an x appended - rm is rmx, cp is cpx, ls is lsx - and mirrors its flags, semantics, diagnostics and exit statuses, on Linux, macOS and Windows alike. It can be used three ways: as commands, as a Go library, and through gnux shell, a portable script interpreter built on the tools. gnux is an independent project, not affiliated with or endorsed by the GNU Project or the FSF; it complements GNU coreutils rather than replacing them.

Three ways to use it

  • Commands - each tool is a command of its own, and a subcommand of the one binary. See the guide.
  • Go library - every tool's engine is an importable package. See Go library.
  • Portable shell - scripts that run the same on every platform. See gnux shell.
rmx -rf build/                  # a command of its own
gnux rmx -rf build/             # a subcommand
gnux shell -c 'rmx -rf build/'  # a line of a portable script

Tools

ToolGNU counterpartWhat it does
archxarchPrint machine architecture
b2sumxb2sumPrint or check BLAKE2b (512-bit) checksums
base32xbase32Encode or decode data in base32
base64xbase64Encode or decode data in base64
basenamexbasenameStrip the directory and suffix from file names
basencxbasencEncode or decode data in one of several encodings
catxcatConcatenate files and print them on standard output
chgrpxchgrpChange group ownership
chmodxchmodChange file mode bits
chownxchownChange file owner and group
cksumxcksumPrint or check checksums and byte counts
commxcommCompare two sorted files line by line
cpxcpCopy files and directories
csplitxcsplitSplit a file into sections determined by context lines
cutxcutRemove sections from each line of files
datexdatePrint the date and time
ddxddConvert and copy a file, block by block
dfxdfReport file system space usage
dircolorsxdircolorsPrint commands that set LS_COLORS, the colors of lsx --color
dirnamexdirnameStrip the last component from file names
dirxdirList directory contents in columns, whether or not the output is a terminal
duxduEstimate file space usage
echoxechoDisplay a line of text
envxenvRun a program in a modified environment, or print the environment
expandxexpandConvert tabs to spaces
exprxexprEvaluate an expression and print its value
factorxfactorPrint the prime factors of each specified integer NUMBER
falsexfalseDo nothing, unsuccessfully
findxfindSearch for files in a directory hierarchy
fmtxfmtReformat each paragraph of text
foldxfoldWrap each input line to fit in a specified width
grepxgrepPrint the lines that match patterns
groupsxgroupsPrint the groups a user is in
headxheadPrint the first part of each file
hostidxhostidPrint the numeric identifier for the current host
hostnamexhostnamePrint the name of the current host system
idxidPrint real and effective user and group IDs
installxinstallCopy files into place and set their mode, owner and group
joinxjoinJoin lines of two files on a common field
killxkillSend a signal to processes, or list signals
linkxlinkCall the link function to create a hard link to a file
lnxlnMake hard or symbolic links between files
lognamexlognamePrint the user's login name
lsxlsList information about files and directory contents
md5sumxmd5sumPrint or check MD5 (128-bit) checksums
mkdirxmkdirCreate the DIRECTORY(ies), if they do not already exist
mkfifoxmkfifoMake named pipes (FIFOs)
mknodxmknodMake block or character special files, or named pipes
mktempxmktempCreate a temporary file or directory, safely, and print its name
mvxmvMove (rename) files and directories
nicexniceRun a program with modified scheduling priority
nlxnlNumber lines of files
nohupxnohupRun a command immune to hangups, with output to a non-terminal
nprocxnprocPrint the number of processing units available
numfmtxnumfmtConvert numbers to and from human-readable strings
odxodDump files in octal and other formats
pastexpasteMerge lines of files
pathchkxpathchkCheck whether file names are valid or portable
pinkyxpinkyShow who is logged in, or what is known about users: a lightweight finger
printenvxprintenvPrint all or part of the environment
printfxprintfFormat and print data
prxprPaginate or columnate files for printing
ptxxptxProduce a permuted index of the words in a text
pwdxpwdPrint the full name of the current working directory
readlinkxreadlinkPrint resolved symbolic links or canonical file names
realpathxrealpathPrint the resolved absolute file name
rmdirxrmdirRemove the DIRECTORY(ies), if they are empty
rmxrmRemove (unlink) files and directories
sedxsedFilter and transform text with a stream editor
seqxseqPrint a sequence of numbers
sha1sumxsha1sumPrint or check SHA-1 (160-bit) checksums
sha224sumxsha224sumPrint or check SHA-224 (224-bit) checksums
sha256sumxsha256sumPrint or check SHA-256 (256-bit) checksums
sha384sumxsha384sumPrint or check SHA-384 (384-bit) checksums
sha512sumxsha512sumPrint or check SHA-512 (512-bit) checksums
shredxshredOverwrite a file to hide its contents, and optionally delete it
shufxshufGenerate random permutations
sleepxsleepDelay for a specified amount of time
sortxsortSort lines of text files
splitxsplitSplit a file into pieces
statxstatDisplay file or file system status
stdbufxstdbufRun a command with modified buffering of its standard streams
sttyxsttyPrint or change terminal line settings
sumxsumPrint the checksum and block count of each FILE
syncxsyncSynchronize cached writes to persistent storage
tacxtacConcatenate and print files in reverse
tailxtailPrint the last part of each file, optionally following it as it grows
teexteeCopy standard input to each FILE, and also to standard output
testxtestCheck file types and compare values
timeoutxtimeoutRun a command with a time limit
touchxtouchUpdate the access and modification times of each FILE to the current time
truextrueDo nothing, successfully
truncatextruncateShrink or extend the size of each FILE to the specified size
trxtrTranslate, squeeze, and/or delete characters from standard input
tsortxtsortWrite a totally ordered list consistent with the partial ordering in FILE
ttyxttyPrint the file name of the terminal connected to standard input
unamexunamePrint system information
unexpandxunexpandConvert spaces to tabs
uniqxuniqReport or omit repeated lines
unlinkxunlinkCall the unlink function to remove the specified file
uptimexuptimeTell how long the system has been running
usersxusersPrint the user names of users currently logged in to the current host
vdirxvdirList directory contents in the long format
wcxwcPrint newline, word, and byte counts for each file
whoamixwhoamiPrint the user name associated with the current effective user ID
whoxwhoShow who is logged on
xargsxxargsBuild and run command lines from standard input
yesxyesOutput a string repeatedly until killed

Try any of them in the playground - it runs the real tools in your browser.

On this page