carlessanagustin
4/8/2016 - 7:30 AM

Windows and Unix command line equivalents

Windows and Unix command line equivalents

Windows commandUnix commandNotes
setenvSet on Windows prints a list of all environment variables. For individual environment variables, set is the same as echo $ on Unix.
set Pathexport $PATHPrint the value of the environment variable using set in Windows.
set PROJ--result: PROJ=c:\project
echo %PROJ%echo $PROJresult: c:\project
set Path=%Path%;c:\projectexport PATH="/path/to/dir:$PATH"
arparp
assignlnCreate a file link
assignln -sOn Unix, a directory may not have multiple links, so instead a symbolic link must be created with ln -s.
assocfile
atat, batch, cron
attribchown, chmodSets ownership on files and directories
cdcdOn Windows, cd alone prints the current directory, but on Unix cd alone returns the user to his home directory.
cdpwdOn Windows, cd alone prints the current directory.
chkdskfsckChecks filesystem and repairs filesystem corruption on hard drives.
clsclearClear the terminal screen
copycp
datetimedateDate on Unix prints the current date and time. Date and time on Windows print the date and time respectively, and prompt for a new date or time.
delrm
deltreerm -rRecursively deletes entire directory tree
dirls"dir" also works on some versions of Unix.
doskey /hF7 keyhistoryThe Unix history is part of the Bash shell.
editVi, emacs, etc.edit brings up a simple text editor in Windows. On Unix, the environment variableEDITOR should be set to the user's preferred editor.
exitexit, Control-DOn Unix, pressing the control key and D simultaneously logs the user out of the shell.
explorerNautilus, etc.The command explorer brings up the file browser on Windows.
fcdiff
findgrep
ftpftp
helpman"help" by itself prints all the commands
hostnamehostname
ipconfig /allifconfig -aThe /all option lets you get the MAC address of the Windows PC
memtopShows system status
mkdirmkdir
moremore, less
movemv
net sessionw, who
net statisticsuptime
nslookupnslookup
pingping
printlprSend a file to a printer.
Reboot, shutdown -rshutdown -r
regeditedit /etc/*The Unix equivalent of the Windows registry are the files under /etc and/usr/local/etc. These are edited with a text editor rather than with a special-purpose editing program.
rmdirrmdir
rmdir /srm -rWindows has a y/n prompt. To get the prompt with Unix, use rm -i. The i means "interactive".
shutdownshutdownWithout an option, the Windows version produces a help message
shutdown -sshutdown -hAlso need -f option to Windows if logged in remotely
sortsort
start&On Unix, to start a job in the background, use command &. On Windows, the equivalent isstart command.
systeminfouname -a
tasklistps"tasklist" is not available on some versions of Windows.
title?In Unix, changing the title of the terminal window is possible but complicated. Search for "change title xterm".
tracerttraceroute
treefind, ls -ROn Windows, use treefind "string"
typecat
veruname -a
xcopycp -RRecursively copy a directory tree