Install uutils tools on Windows
Install uutils tools on Windows
Introduction
Canonical has been working on a reimplementation of the core Linux tools for some time.
The project is mature enough to run on Linux and, thanks to Rust, is fairly compatible with Windows.
With a few modifications, it is possible to access all Linux tools directly from Windows — this is the goal of this article.
Build
Many packages are obviously not compatible with Windows (such as chmod, etc.) and must be excluded.
There are no issues with the command provided by Canonical in the README, but the tools are installed as a single binary (coreutils.exe), whereas we want to use them individually.
I therefore excluded the problematic packages from the build and instructed Cargo to build each binary separately (--workspace --bins):
Tool build
cargo build --release --workspace --bins --exclude uu_stdbuf --exclude uu_install --exclude uu_stat --exclude uu_who --exclude uu_timeout --exclude uu_chroot --exclude uu_pinky --exclude uu_chown --exclude uu_stty --exclude uu_nohup --exclude uu_nice --exclude uu_chmod --exclude uu_chgrp --exclude uu_id --exclude uu_mkfifo --exclude uu_kill --exclude uu_uptime --exclude uu_users --exclude uu_mknod --exclude uu_groups --exclude uu_logname --exclude uu_hostid
Installation
We can then install the tools:
Clean installation of the tools
mkdir C:\tools\coreutils
copy target\release\*.exe C:\tools\coreutils\
Note that cargo install is excluded because it does not support our options.
We can then simply add our tools to the global PATH (Win+R → sysdm.cpl → Advanced → Environment Variables → add C:\tools\coreutils).
PowerShell tools such as ls will still take priority (they are often aliases).
To remove them, you need to delete the aliases first:
Edit
$PROFILE
notepad.exe $PROFILE
Add to $PROFILE
Remove-Item Alias:ls -ErrorAction SilentlyContinue
Exit and restart PowerShell after these changes — many Linux tools are now installed!
Some useful added tools:
- base64
- cut
- date
- dir
- more
- shaxxxsum
- sleep
- wc
- whoami
Finally, to secure the folder (and prevent everyone from modifying the binaries):
Remove ACL inheritance, grant RW to administrators, RX to users
icacls C:\tools /inheritance:r
icacls C:\tools /grant "Administrators:(OI)(CI)F"
icacls C:\tools /grant "Users:(OI)(CI)RX"
Commands may need adjustment for another Windows language…
Then verify permissions:
icacls C:\tools