DOS Command |
UNIX or Bash Command |
Action |
DIR |
-l (or use ls -lF)(-a all files)
(df -k Space remaining on filesystem) |
List directory contents |
DIR *.* /o-d
DIR *.* /v /os
DIR /s
DIR /aa |
ls -tr
ls -ls
ls -R
ls -a |
List directory contents by reverse time of modification/creation.
List files and size
List directory/sub-directory contents recursively.
List hidden files. |
TREE |
|
List directory recursivly |
CD |
|
Change directory |
MKDIR
MD |
|
Make a new directory |
ASSIGN |
|
Create a file or directory link |
RMDIR
RD |
|
Remove a directory |
CHDIR |
|
Display directory location |
DEL
ERASE |
-iv |
Remove a file |
RMDIR /S (NT)
DELTREE (Win 95...) |
rm -R |
Remove all directories and files below given directory |
COPY |
-piv |
Copy a file |
XCOPY |
-R |
Copy all file of directory recursivly |
RENAME or MOVE |
-iv |
Rename/move a file |
TYPE |
|
Dump contents of a file to users screen |
MORE |
|
Pipe output a single page at a time |
HELP or COMMAND /? |
|
Online manuals |
CLS |
ctrl-l |
Clear screen |
EXIT
EXIT0 |
exit 0 |
Exit a shell |
FIND
FINDSTR |
|
Look for a word in files given in command line |
COMP |
|
Compare two files and show differences. Also see comm, cmp, mgdiff and tkdiff. |
FC |
|
Compare two files and show differences. Also see comm, cmp, mgdiff and tkdiff. |
SET |
set and env |
List all environment variables |
SET variable=value
echo %variable% |
set
export variable=value
echo $variable
|
Set environment variables
Show environment variables |
ECHO text |
echo text |
Echo text to screen |
SET variable |
setenv (for C shell) or export VAR=val (for Korn shell. Also VAR=val) |
Set environment variables |
PATH
PATH %PATH%;C:\DIR |
echo $PATH
PATH=$PATH:/dir |
Display search path for executables.
Set PATH environment variable. |
PROMPT $p$g |
export PS1='\h(\u)\W> ' |
Set user command prompt. |
DATE or TIME |
|
Show date. (also set date - DOS only) |
DOSKEY /h |
|
List command history |
DOSKEY NAME=command |
NAME=command |
Set command alias |
BREAK ON |
trap |
Trap ctrl-break / Trap signals. |
SORT |
|
Sort data alphabetically/numerically |
EDLIN |
|
Line mode editor |
EDIT filename.txt |
,
,
,
,
,dtpad |
Edit a file. The Linux editor which looks most like DOS edit is probably Pico. (Not a recomendation!) |
BACKUP files A:\ |
-cvf /dev/fd0 files
,
doswrite -a file (AIX only) |
Save files to floppy.
See |
RESTORE A:\ files |
tar -xvf /dev/fd0 files
,
dosread -a file (AIX only) |
Read files from floppy.
See |
ATTRIB [+r|-r] [+a|-a] [+s|-s] [path\file] /s |
|
Change file permissions. DOS: +:set to -:remove 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 |
|
Print a file |
CALL
COMMAND /C (DOS), CMD (NT) |
script ()
. script ()
sh script |
Execute script from within batch shell. |
MEM |
|
Show free memory on system |
TASKLIST (WIN2K, XP) |
|
List executable name, process ID number and memory usage of active processes |
MSD |
lsdev |
Show system info (Command borrowed from AIX) |
SCANDISK
DEFRAG C: |
|
Check and repair hard drive file system |
CHDISK |
-s |
Disk usage. |
FDISK |
|
Tool to partition a hard drive. |
SUBST V: C:\directory\path |
|
Mount a drive letter to a folder/directory on your hard drive. |
FORMAT |
See: and for floppies |
Format drive file system.
For floppy drive use see |
VER |
-a
echo $SHELL
cat /etc/issue |
Operating system/shell version |
pkzip |
and
|
Compress and uncompress files/directories. Use tar to create compilation of a directory before compressing.
Linux also has
,
|
HOSTNAME |
|
Print host name of computer |
PING |
|
Send packets to a network host |
TRACERT |
|
Show routes and router hops to given network destination. |
IPCONFIG (NT)
WINIPCFG (Win 95...)
|
|
Display/configure network interface |
NBTSTAT (Netbios info: -n, -c)
NBTSTAT -A IP-address |
host-name
host-name |
Print DNS info for host. |
NBTSTAT -a hostname |
-A hostname |
lookup NetBIOS names. |
ROUTE PRINT |
-n |
Print routing table. |
NET HELP START |
--list |grep on |
List services. |
NET STARTservice-name
NET STOPservice-name |
service-name start
service-name stop |
Start/stop service/daemon. |
NET SHARES |
|
Show mounted shares/filesystems. |
NET SEND (NT) |
smbclient -M MS-Windows-host-name
|
Send pop-up to a MS/Windows PC
Send message to another Unix/Linux user. See |
WIN |
|
Start X-Windows. |
REBOOT |
-r now |
Reboot system. |