coreutils in V

December 23, 2025 · View on GitHub

This repository contains programs equivalent to GNU coreutils, written in the V language.

Goal

Complete set of coreutils, written as closely as possible to the POSIX spec, with as many GNU extensions as feasible.

We are looking for solid, working implementations of the commands, not 100% 1-to-1 parity, especially not quirks and unintended side-effects.

The reference implementation is GNU coreutils 8.32.

Layout

Each command has it's own separate subdirectory under src, in case the implementor wishes to create multiple .v files to implement a command, or add a README.md specifically for that command.

Developing

Please use the common module for command line/help handling. This will make the command input/output consistent across the tools.

Building

Running make or v run build.vsh will build all the programs in bin/. Use JOBS=N make or v run build.vsh --cpus=N to compile in parallel.

Note: support for access to user account info (via utmp) is limited to POSIX-like platforms. And, so, for Windows, utilities requiring utmp support (uptime, users, who, whoami) are currently skipped during the default build process.

Contributing

Contributions are welcome!

Please only contribute versions of the original utilities written in V. Contributions written in other languages will likely be rejected.

When your contribution is finalized, don't forget to update the completed count below and mark it as done in this README.md. Thanks!

NOTE: When testing on Windows, comparison tests are currently run against uutils/coreutils, a Rust re-implementation of GNU coreutils. They are not 100% compatiable. If you encounter different behaviors, compare against the true GNU coreutils version on the Linux-based tests first.

Completed (76/109) - 69% done!

DoneCmdDescriptonWindows
[Alternate form of test
archPrint machine hardware name
b2sumPrint or check BLAKE2 digests
base32Transform data into printable data
base64Transform data into printable data
basenameStrip directory and suffix from a file name
basencTransform data into printable data
catConcatenate and write files
chconChange SELinux context of file
chgrpChange group ownership
chmodChange access permissions
chownChange file owner and group
chrootRun a command with a different root directory
cksumPrint CRC checksum and byte counts
commCompare two sorted files line by line
coreutilsMulti-call program
cpCopy files and directories
csplitSplit a file into context-determined pieces
cutPrint selected parts of lines
datePrint or set system date and time
ddConvert and copy a file
dfReport file system disk space usage
dirBriefly list directory contents
dircolorsColor setup for ls
dirnameStrip last file name component
duEstimate file space usage
echoPrint a line of text
envRun a command in a modified environment
expandConvert tabs to spaces
exprEvaluate expressions
factorPrint prime factors
falseDo nothing, unsuccessfully
fmtReformat paragraph text
foldWrap input lines to fit in specified width
groupsPrint group names a user is in
headOutput the first part of files
hostidPrint numeric host identifier
hostnamePrint or set system name
idPrint user identity
installCopy files and set attributes
joinJoin lines on a common field
killSend a signal to processes
linkMake a hard link via the link syscall
lnMake links between files
lognamePrint current login name
lsList directory contents
md5sumPrint or check MD5 digests
mkdirMake directories
mkfifoMake FIFOs (named pipes)
mknodMake block or character special files
mktempCreate temporary file or directory
mvMove (rename) files
niceRun a command with modified niceness
nlNumber lines and write files
nohupRun a command immune to hangups
nprocPrint the number of available processors
numfmtReformat numbers
odWrite files in octal or other formats
pasteMerge lines of files
pathchkCheck file name validity and portability
pinkyLightweight finger
prPaginate or columnate files for printing
printenvPrint all or some environment variables
printfFormat and print data
ptxProduce permuted indexes
pwdPrint working directory
readlinkPrint value of a symlink or canonical file name
realpathPrint the resolved file name
rmRemove files or directories
rmdirRemove empty directories
runconRun a command in specified SELinux context
seqPrint numeric sequences
sha1sumPrint or check SHA-1 digests
sha224sumPrint or check SHA-2 224 bit digests
sha256sumPrint or check SHA-2 256 bit digests
sha384sumPrint or check SHA-2 384 bit digests
sha512sumPrint or check SHA-2 512 bit digests
shredRemove files more securely
shufShuffling text
sleepDelay for a specified time
sortSort text files
splitSplit a file into pieces
statReport file or file system status
stdbufRun a command with modified I/O stream buffering
sttyPrint or change terminal characteristics
sumPrint checksum and block counts
syncSynchronize cached writes to persistent storage
tacConcatenate and write files in reverse
tailOutput the last part of files
teeRedirect output to multiple files or processes
testCheck file types and compare values
timeoutRun a command with a time limit
touchChange file timestamps
trTranslate, squeeze, and/or delete characters
trueDo nothing, successfully
truncateShrink or extend the size of a file
tsortTopological sort
ttyPrint file name of terminal on standard input
unamePrint system information
unexpandConvert spaces to tabs
uniqUniquify files
unlinkRemove files via the unlink syscall
uptimePrint system uptime and load
usersPrint login names of users currently logged in
vdirVerbosely list directory contents
wcPrint newline, word, and byte counts
whoPrint who is currently logged in
whoamiPrint effective user ID
yesPrint a string until interrupted

Windows ✓ if the utility exists in the Windows version of GNU coreutils.