You are on page 1of 3

!!!Always use command name --help to get the detailed information of a command!!!

E.g. : to get the information for command dir, you use: dir --help

Command Comparison:
DOS Command UNIX or Bash Command Action
DIR ls -l (or use ls -lF)(-a all files)
(df -k Space remaining on List directory contents
filesystem)
DIR *.* /o-d List directory contents by reverse time of
ls -tr
DIR *.* /v /os modification/creation.
ls -ls
DIR /s List files and size
ls -R
DIR /aa List directory/sub-directory contents recursively.
ls -a
List hidden files.
TREE ls -R List directory recursivly
CD cd Change directory
MKDIR
mkdir Make a new directory
MD
ASSIGN ln Create a file or directory link
RMDIR
rmdir Remove a directory
RD
CHDIR pwd Display directory location
DEL
rm -iv Remove a file
ERASE
RMDIR /S (NT)
rm -R Remove all directories and files below given directory
DELTREE (Win 95...)
COPY cp -piv Copy a file
XCOPY cp -R Copy all file of directory recursivly
RENAME or MOVE mv -iv Rename/move a file
TYPE cat Dump contents of a file to users screen
MORE more Pipe output a single page at a time
HELP or COMMAND /? man Online manuals
clear
CLS Clear screen
ctrl-l
EXIT exit Exit a shell
EXIT0 exit 0
FIND
grep Look for a word in files given in command line
FINDSTR
Compare two files and show differences. Also see
COMP diff
comm, cmp, mgdiff and tkdiff.
Compare two files and show differences. Also see
FC diff
comm, cmp, mgdiff and tkdiff.
SET set and env List all environment variables
SET variable=value set Set environment variables
echo %variable% Show environment variables

export variable=value
echo $variable
ECHO text echo text Echo text to screen
setenv (for C shell) or export
SET variable VAR=val (for Korn shell. Also Set environment variables
VAR=val)
PATH echo $PATH Display search path for executables.
PATH %PATH%;C:\DIR PATH=$PATH:/dir Set PATH environment variable.
PROMPT $p$g export PS1='\h(\u)\W> ' Set user command prompt.
DATE or TIME date Show date. (also set date - DOS only)
DOSKEY /h history List command history
DOSKEY
alias NAME=command Set command alias
NAME=command
BREAK ON trap Trap ctrl-break / Trap signals.
SORT sort Sort data alphabetically/numerically
EDLIN ed Line mode editor
EDIT filename.txt Edit a file. The Linux editor which looks most like
pico, gnp, vi, xedit, xemacs,dtpad
DOS edit is probably Pico. (Not a recomendation!)
BACKUP files A:\ tar -cvf /dev/fd0 files
Save files to floppy.
mdir, mcopy
See Using DOS floppies
doswrite -a file (AIX only)
tar -xvf /dev/fd0 files
Read files from floppy.
RESTORE A:\ files mdir, mcopy
See Using DOS floppies
dosread -a file (AIX only)
ATTRIB [+r|-r] [+a|-a] Change file permissions. DOS: +:set to -:remove
chmod
[+s|-s] [path\file] /s r:Read only a:Archive s:System /s:recursively
ATTRIB +h or -h mv file .file Change file to a hidden file - rename file with prefix "."
PRINT lpr Print a file
CALL source script (cshrc)
COMMAND /C (DOS), . script (bash) Execute script from within batch shell.
CMD (NT) sh script
MEM free
Show free memory on system
top
TASKLIST (WIN2K, XP) ps -aux List executable name, process ID number and
top memory usage of active processes
MSD lsdev Show system info (Command borrowed from AIX)
SCANDISK fsck
Check and repair hard drive file system
DEFRAG C: debugfs
CHDISK du -s Disk usage.
FDISK fdisk Tool to partition a hard drive.
SUBST V: Mount a drive letter to a folder/directory on your hard
mount
C:\directory\path drive.
FORMAT mke2fs Format drive file system.
See: fdformat and mformat for For floppy drive use see YoLinux Tutorial Using DOS
floppies Floppies with Linux
uname -a
VER echo $SHELL Operating system/shell version
cat /etc/issue
pkzip Compress and uncompress files/directories. Use tar
tar and zip to create compilation of a directory before
compressing. Linux also has compress, gzip
HOSTNAME hostname Print host name of computer
PING ping Send packets to a network host
Show routes and router hops to given network
TRACERT traceroute
destination.
IPCONFIG (NT)
ifconfig Display/configure network interface
WINIPCFG (Win 95...)
NBTSTAT (Netbios info:
-n, -c) nslookup host-name
Print DNS info for host.
NBTSTAT -a host-name host host-name
NBTSTAT -A IP-address
ROUTE PRINT route -n Print routing table.
NET HELP START chkconfig --list |grep on List services.
NET STARTservice-
name service service-name start
Start/stop service/daemon.
NET STOPservice- service service-name stop
name
NET SHARES df Show mounted shares/filesystems.
smbclient -M MS-Windows-host- Send pop-up to a MS/Windows PC
NET SEND <node-
name Send message to another Unix/Linux user. See
name> <message> (NT)
talk YoLinux tutorial
WIN startx Start X-Windows.
REBOOT shutdown -r now Reboot system.

Shell Descriptor/Operators:
UNIX or Bash
DOS Descriptor/Operator Description
Descriptor/Operator
\ / Directory path delimiter
.\ ./ Current directory
..\ ../ Parent directory
ctrl-z ctrl-d End of file/close shell
ctrl-c ctrl-c Interrupt/process break
* * file name wild card
? ? Single character wild card
%VAR% $VAR Variable prefix
First, second and third shell command line
%1 %2 %3 $1 $2 $3
arguments.
/ - Command line option flag prefix
| | Pipe
> > stdout redirection
>> >> stdout redirection overwrite
< < stdin redirection

Equivalent Linux and MS/Windows GUI Applications:


MS/Windows Command Linux Command Description
C:\WINDOWS\cmd gnome-terminal Command Text Terminal
konsole
C:\WINDOWS\explorer nautilus --no- File browser
desktop
c:\Program Files\Internet Explorer\iexplore firefox Web browser
mozilla
C:\WINDOWS\notepad gedit Text editor
C:\Program Files\Windows
NT\Accessories\wordpad
C:\Program Files\Microsoft oowriter MS/Office and Open Office suites
Office\Office10\winword oocalc (ooffice)
excel ooimpress
powerpnt
C:\Program Files\Adobe\Acrobat acroread Adobe PDF viewer
7.0\Reader\acrord32
mspaint tuxpaint Graphics and painting program
xfig
gimp
C:\Program Files\WinZip\winzip32 file-roller File compress / decompress / pack /
unpack

You might also like