Wednesday, January 10, 2007

Get Linux/Unix command lines for Windows

Sometimes the windows command line just isn't good enough, and instead of dir you want ls, or you want to count the number of lines in a file with a wc -l or grep for something. Cygwin is great and all, but it is a bit of overkill for most of my situations. UnxUtils.zip contains all of the above and more, and all the tools are accessible from the windows command line!

The official site's download link is down at the time of posting, but I have found a number of unofficial mirrors:

ftp://81.30.199.66/pub/windows/unixutils/UnxUtils.zip
ftp://ftp.ufanet.ru/pub/windows/unixutils/UnxUtils.zip
ftp://193.40.239.25/pub/windows/msutils/UnxUtils.zip
ftp://194.226.230.170/pub/windows/devel/UnxUtils.zip
http://www.mirrorservice.org/sites/ftp.locustworld.com/UnxUtils.zip

Once you have downloaded and unzipped into a directory you need to add them to your windows path, so that when you type ls your computer knows where to find it.

  • Right click "My Computer" then click properties
  • In the "System Properties" window click the advanced tab
  • Click the "Environment Variables" button
  • Click the "PATH" variable and click edit
  • Add a semicolon to the end of the "Variable value" field and then type in the location you unzipped UnxUtils.zip to followed by \usr\local\wbin
To test your new utilities open up a command prompt (you can find it hiding in Start->Programs->Accessories->Command Prompt) and try one out! The standard UnxUtils contains the following tools:

(this list generated by typing ls *.exe | sed -e "s/\.exe//g" > utils.txt from within the wbin directory - from a windows command prompt!)


agrep
ansi2knr
basename
bc
bison
bunzip2
bzip2
bzip2recover
cat
chgrp
chmod
chown
cksum
cmp
comm
compress
cp
csplit
cut
date
dc
dd
df
diff
diff3
dircolors
dirname
du
echo
egrep
env
expand
expr
factor
fgrep
find
flex
fmt
fold
fsplit

gawk
gclip
gplay
grep
gsar
gunzip
gzip
head
id
indent
install
join
jwhois
less
lesskey
ln
logname
ls
m4
make
makedepend
makemsg
man
md5sum
mkdir
mkfifo
mknod
mv
mvdir
nl
od
paste
patch
pathchk
pclip
pr
printenv
printf
pwd


recode
rm
rman
rmdir
sdiff
sed
seq
shar
sleep
sort
split
stego
su
sum
sync
tac
tail
tar
tee
test
touch
tr
type
uname
unexpand
uniq
unrar
unshar
unzip
uudecode
uuencode
wc
wget
which
whoami
xargs
yes
zcat
zip

No comments: