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 scriptTools
| Tool | GNU counterpart | What it does |
|---|---|---|
| archx | arch | Print machine architecture |
| b2sumx | b2sum | Print or check BLAKE2b (512-bit) checksums |
| base32x | base32 | Encode or decode data in base32 |
| base64x | base64 | Encode or decode data in base64 |
| basenamex | basename | Strip the directory and suffix from file names |
| basencx | basenc | Encode or decode data in one of several encodings |
| catx | cat | Concatenate files and print them on standard output |
| chgrpx | chgrp | Change group ownership |
| chmodx | chmod | Change file mode bits |
| chownx | chown | Change file owner and group |
| cksumx | cksum | Print or check checksums and byte counts |
| commx | comm | Compare two sorted files line by line |
| cpx | cp | Copy files and directories |
| csplitx | csplit | Split a file into sections determined by context lines |
| cutx | cut | Remove sections from each line of files |
| datex | date | Print the date and time |
| ddx | dd | Convert and copy a file, block by block |
| dfx | df | Report file system space usage |
| dircolorsx | dircolors | Print commands that set LS_COLORS, the colors of lsx --color |
| dirnamex | dirname | Strip the last component from file names |
| dirx | dir | List directory contents in columns, whether or not the output is a terminal |
| dux | du | Estimate file space usage |
| echox | echo | Display a line of text |
| envx | env | Run a program in a modified environment, or print the environment |
| expandx | expand | Convert tabs to spaces |
| exprx | expr | Evaluate an expression and print its value |
| factorx | factor | Print the prime factors of each specified integer NUMBER |
| falsex | false | Do nothing, unsuccessfully |
| findx | find | Search for files in a directory hierarchy |
| fmtx | fmt | Reformat each paragraph of text |
| foldx | fold | Wrap each input line to fit in a specified width |
| grepx | grep | Print the lines that match patterns |
| groupsx | groups | Print the groups a user is in |
| headx | head | Print the first part of each file |
| hostidx | hostid | Print the numeric identifier for the current host |
| hostnamex | hostname | Print the name of the current host system |
| idx | id | Print real and effective user and group IDs |
| installx | install | Copy files into place and set their mode, owner and group |
| joinx | join | Join lines of two files on a common field |
| killx | kill | Send a signal to processes, or list signals |
| linkx | link | Call the link function to create a hard link to a file |
| lnx | ln | Make hard or symbolic links between files |
| lognamex | logname | Print the user's login name |
| lsx | ls | List information about files and directory contents |
| md5sumx | md5sum | Print or check MD5 (128-bit) checksums |
| mkdirx | mkdir | Create the DIRECTORY(ies), if they do not already exist |
| mkfifox | mkfifo | Make named pipes (FIFOs) |
| mknodx | mknod | Make block or character special files, or named pipes |
| mktempx | mktemp | Create a temporary file or directory, safely, and print its name |
| mvx | mv | Move (rename) files and directories |
| nicex | nice | Run a program with modified scheduling priority |
| nlx | nl | Number lines of files |
| nohupx | nohup | Run a command immune to hangups, with output to a non-terminal |
| nprocx | nproc | Print the number of processing units available |
| numfmtx | numfmt | Convert numbers to and from human-readable strings |
| odx | od | Dump files in octal and other formats |
| pastex | paste | Merge lines of files |
| pathchkx | pathchk | Check whether file names are valid or portable |
| pinkyx | pinky | Show who is logged in, or what is known about users: a lightweight finger |
| printenvx | printenv | Print all or part of the environment |
| printfx | printf | Format and print data |
| prx | pr | Paginate or columnate files for printing |
| ptxx | ptx | Produce a permuted index of the words in a text |
| pwdx | pwd | Print the full name of the current working directory |
| readlinkx | readlink | Print resolved symbolic links or canonical file names |
| realpathx | realpath | Print the resolved absolute file name |
| rmdirx | rmdir | Remove the DIRECTORY(ies), if they are empty |
| rmx | rm | Remove (unlink) files and directories |
| sedx | sed | Filter and transform text with a stream editor |
| seqx | seq | Print a sequence of numbers |
| sha1sumx | sha1sum | Print or check SHA-1 (160-bit) checksums |
| sha224sumx | sha224sum | Print or check SHA-224 (224-bit) checksums |
| sha256sumx | sha256sum | Print or check SHA-256 (256-bit) checksums |
| sha384sumx | sha384sum | Print or check SHA-384 (384-bit) checksums |
| sha512sumx | sha512sum | Print or check SHA-512 (512-bit) checksums |
| shredx | shred | Overwrite a file to hide its contents, and optionally delete it |
| shufx | shuf | Generate random permutations |
| sleepx | sleep | Delay for a specified amount of time |
| sortx | sort | Sort lines of text files |
| splitx | split | Split a file into pieces |
| statx | stat | Display file or file system status |
| stdbufx | stdbuf | Run a command with modified buffering of its standard streams |
| sttyx | stty | Print or change terminal line settings |
| sumx | sum | Print the checksum and block count of each FILE |
| syncx | sync | Synchronize cached writes to persistent storage |
| tacx | tac | Concatenate and print files in reverse |
| tailx | tail | Print the last part of each file, optionally following it as it grows |
| teex | tee | Copy standard input to each FILE, and also to standard output |
| testx | test | Check file types and compare values |
| timeoutx | timeout | Run a command with a time limit |
| touchx | touch | Update the access and modification times of each FILE to the current time |
| truex | true | Do nothing, successfully |
| truncatex | truncate | Shrink or extend the size of each FILE to the specified size |
| trx | tr | Translate, squeeze, and/or delete characters from standard input |
| tsortx | tsort | Write a totally ordered list consistent with the partial ordering in FILE |
| ttyx | tty | Print the file name of the terminal connected to standard input |
| unamex | uname | Print system information |
| unexpandx | unexpand | Convert spaces to tabs |
| uniqx | uniq | Report or omit repeated lines |
| unlinkx | unlink | Call the unlink function to remove the specified file |
| uptimex | uptime | Tell how long the system has been running |
| usersx | users | Print the user names of users currently logged in to the current host |
| vdirx | vdir | List directory contents in the long format |
| wcx | wc | Print newline, word, and byte counts for each file |
| whoamix | whoami | Print the user name associated with the current effective user ID |
| whox | who | Show who is logged on |
| xargsx | xargs | Build and run command lines from standard input |
| yesx | yes | Output a string repeatedly until killed |
Try any of them in the playground - it runs the real tools in your browser.