Skip to content

Instantly share code, notes, and snippets.

@rathorsunpreet
Forked from carlessanagustin/win2ix.md
Last active May 17, 2024 16:21
Show Gist options
  • Save rathorsunpreet/0e77897c2232cbc6d11d5369b4bfaa3a to your computer and use it in GitHub Desktop.
Save rathorsunpreet/0e77897c2232cbc6d11d5369b4bfaa3a to your computer and use it in GitHub Desktop.
Windows and Unix command line equivalents
Windows command Unix command Notes
F7 key history On Windows, system uses doskey.exe . It automatically starts when opening Command Prompt and history can be viewed with the F7 key. The Unix history is part of the Bash shell.
arp arp
assoc <.ext> file Command for Windows, will display the file association for the specified extension. If filetype is not specified, then it will delete the association. If no extension is specified, then it displays all current file associations.
at at, batch, cron
attrib chown, chmod Sets ownership on files and directories
cd cd
cd pwd On Windows, cd alone prints the current directory.
chkdsk fsck Checks filesystem and repairs filesystem corruption on hard drives.
cls clear Clear the terminal screen
copy cp
date /t date Date on Unix prints the current date and time. On Windows prints the date and prompts for a new one. Press Enter to keep the same date and if command extensions are enabled then with the "/t" switch, the command only prints the date.
del rm
dir ls "dir" also works on some versions of Unix.
echo %PROJ% echo $PROJ result: c:\project
edit Vi, emacs, etc. "edit" used to bring up a simple text editor in Windows. No longer available on modern Windows 64-bit editions. On Unix, the environment variable "EDITOR" should be set to the user's preferred editor.
exit exit, Control-D On Unix, pressing the control key and D simultaneously logs the user out of the shell.
explorer Nautilus, etc. The command explorer brings up the file browser on Windows.
fc diff
find OR findstr grep
ftp ftp
help man "help" by itself prints all the commands
hostname hostname
ipconfig /all ifconfig -a The /all option lets you get the MAC address of the Windows PC
mkdir mkdir
mklink /h ln Create a file link
mklink ln -s On Unix, a directory may not have multiple links, so instead a symbolic link must be created with ln -s.
more more, less
move mv
net session w, who Use admin prompt with Windows, otherwise you will get "System error 5 has occurred. Access is Denied." message.
net statistics uptime On Windows PC, use "workstation" and for Server, use "server" in place of
nslookup nslookup
ping ping On Windows, the default count is 3, on Unix you can specify count with the "-c num" syntax.
print lpr Send a file to a printer.
regedit edit /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.
rmdir /s rm -r Recursively deletes entire directory tree. Windows has a y/n prompt. To get the prompt with Unix, use rm -i. The i means "interactive".
rmdir rmdir
set PROJ -- result: PROJ=c:\project
set Path export $PATH Print the value of the environment variable using set in Windows.
set Path=%Path%;c:\project export PATH="/path/to/dir:$PATH"
set env Set on Windows prints a list of all environment variables. For individual environment variables, set is the same as echo $ on Unix.
shutdown /r shutdown -r
shutdown /s shutdown -h Also need -f option to Windows if logged in remotely
shutdown shutdown Without an option, the Windows version produces a help message
sort sort
start & On Unix, to start a job in the background, use command &. On Windows, the equivalent isstart command.
systeminfo uname -a
tasklist ps "tasklist" is not available on some versions of Windows.
tasklist top Shows system status
time /t date On Unix prints, the date and time. On windows, time prints and asks for a new time. Press Enter to keep the current time. If command extensions are enabled, then with the switch "/t" only prints the time.
title -- For Linux, either set the "PS1" variable or use the "PROMPT_COMMAND" varaible. If using "bash", then set the variables in your ".bashrc" file to auto apply the value.
tracert traceroute
tree or dir /s find, ls -R On Windows, use tree
type cat
ver uname -a
xcopy cp -R Recursively copy a directory tree
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment