Computer World
Planet Fox > Computer World > Common Unix and Windows Commands

Common UNIX and Windows Commands

It might sound weird, but I do a lot of stuff on the command line, even on my Windows machines. There are times when it's just quicker and easier to open a terminal and run a few commands than to click on a bunch of stuff. If you're logged in remotely or you need to setup or repair a system, a good knowledge of text commands is a lifesaver. This is intended as a quick and handy reference guide to anyone who needs to do something, but isn't familiar with Unix and Windows commands and doesn't have time to wade through 600 pages of documentation.
Since most of the important commands are similar or identical to DOS commands, anyone should be able to learn these pretty quickly. Windows takes flags in the form a forward slash followed by the flag, for example, /i, while Unix takes flags that are formatted as a dash followed by the flag, for example, -i.
A lot of the Unix commands mentioned have other flags and arguments, you can learn more about them by typing man followed by the name of the command in question. To learn more about a Windows command type /? after the command. Remember that Unix commands are case sensitive, rm is not the same as RM. Both Windows and Unix use * as a wildcard operator.

File Operations

Unix Command
Windows Command
What it Does
cd
cd
Change the working directory
pwd
cd (no arguments)
Show the name of the working directory
ls
dir
Show the contents of a directory
ls -R
tree
Show the contents of  the directory tree
(Note: don't ever do this in your root directory or /var)
cp
copy
Copy a file
mv
move
Move a file
mv
ren
Rename a file
rm
del
Delete a file
rm -r
rd
Remove a directory
mkdir
mkdir
Make a new directory
ln -s
mklink
Create a symbolic link to a file
find
find
Search for a file
chmod
cacls
Change file permissions
chown
takeown
Change file ownership

System Operations

Unix Command
Windows Command
What it Does
shutdown -h now
shutdown
Shuts the system down in an orderly fashion
whoami
whoami
Show the username of the logged-in user
date
date and/or time
Display and/or set the date and time
top
tasklist
Display a list of running programs
kill
taskkill
Stop a running program
uname -a
ver
Display the system version
dmesg
systeminfo
Display information about the system
fdisk
diskpart
Edit disk partitions
newfs
format
Format disk partitions
setenv
set
Change environment variables
at
schtasks
Run a program at the given time
Control + C
Control + C
Stops the currently running program

Text Operations

Unix Command
Windows Command
What it Does
cat
type
Show the contents of a text file
more
more
Show the contents of a text file, one page at a time
ed
edlin
Line mode text editor
ee
edit
Screen mode text editor (Note: this might not work when logged in via older versions of telnet, in that case, use vi, ex, or ed)
grep
findstr
Search for a string in a file
diff
fc
Compare two files
lpr
print
Print a text file to the default printer
clear
cls
Clear the screen

Networking

Unix Command
Windows Command
What it Does
telnet
telnet
Telnet client
ftp
ftp
File transfer protocol client
ifconfig
ipconfig
View/configure the system's network interfaces
ping
ping
Send an ICMP echo request to a remote host
nslookup
nslookup
Lookup the IP address for a domain
traceroute
tracert
Trace the packet's route to a given host
netstat
netstat
View active network connections
arp
arp
Show MAC addresses for known hosts
Powered by FreeBSD
Valid HTML 4.01
Site Map
©MMIX-MMXIV Planet Fox