Skip to content

Instantly share code, notes, and snippets.

@zett42
Created February 25, 2023 08:39
Show Gist options
  • Save zett42/72fe42c418d53ad03d5e17ffd7fd8104 to your computer and use it in GitHub Desktop.
Save zett42/72fe42c418d53ad03d5e17ffd7fd8104 to your computer and use it in GitHub Desktop.
Create Coreutils PowerShell aliases
$coreUtils = @'
binary
arch
b2sum
b3sum
base32
base64
basename
basenc
cat
chcon
chgrp
chmod
chown
chroot
cksum
comm
cp
csplit
cut
date
dd
df
dir
dircolors
dirname
du
echo
env
expand
expr
factor
false
fmt
fold
groups
hashsum
head
hostid
hostname
id
install
join
kill
link
ln
logname
ls
md5sum
mkdir
mkfifo
mknod
mktemp
more
mv
nice
nl
nohup
nproc
numfmt
od
paste
pathchk
pinky
pr
printenv
printf
ptx
pwd
readlink
realpath
relpath
rm
rmdir
runcon
seq
sha1sum
sha224sum
sha256sum
sha3-224sum
sha3-256sum
sha3-384sum
sha3-512sum
sha384sum
sha3sum
sha512sum
shake128sum
shake256sum
shred
shuf
sleep
sort
split
stat
stdbuf
stty
sum
sync
tac
tail
tee
test
timeout
touch
tr
true
truncate
tsort
tty
uname
unexpand
uniq
unlink
uptime
users
vdir
wc
who
whoami
yes
'@ -split '\r?\n'
foreach($cmd in $coreUtils) {
Remove-Alias $cmd -ErrorAction SilentlyContinue
Set-Item function:$cmd -Value { coreutils $cmd $args }.GetNewClosure()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment