MS-DOS
Linux
Copies files
copy
cp
cpthisfile.txt/home/thisdire
Moves files
move
mv
mvthisfile.txt/home/thisdire
Lists files
dir
ls
ls
Clears screen
cls
clear
clear
exit
exit
exit
date
date
date
Deletes files
del
rm
rmthisfile.txt
echo
echo
echothis message
edit
gedit([a])
geditthisfile.txt
fc
diff
difffile1file2
find
grep
(if
diskette is inA:)
mke2fs
/sbin/mke2fs/dev/fd0 (/dev/fd0
Displays command
help
command/?
man
Creates a directory
mkdir
mkdir
mkdirdirectory
more
less([b])
lessthisfile.txt
Renames a file
ren
mv([c])
mvthisfile.txtthatfile.txt
chdir
pwd
pwd
Formats a diskette
formata:
of A:)
or info
mancommand
Command's Purpose
MS-DOS
Linux
cdpathname
cdpathname
cd/directory/directory
Changes directories
with a relative path
cd..
cd..
cd..
time
date
date
mem
free
free
Entering Commands
ACTION
LINUX
DOS
COMMENTS
Get command
help.
man <some
command>
help, command /?
Find related
commands.
Flip through
entered
commands.
Show command
history.
Set a command
alias.
Clear the screen.
Trap ctrl-break
or trap signals.
history
doskey /h
ACTION
LINUX
DOS
COMMENTS
startx
shutdown -r now
exit, exit 0
uname -a, cat /etc/issue
win
reboot
exit, exit0
ver
LINUX
DOS
COMMENTS
format
LINUX
DOS
List
environment
variables.
Set an
environment
variable.
Show the
contents of an
environment
variable.
Display text on
screen.
Display the
system search
path.
Append a
directory to the
system search
path.
set, env
set
COMMENTS
echo %variable%
echo text
echo text
echo $PATH
PATH
PATH=$PATH:/dir
PATH %PATH
%;C:\DIR
ACTION
LINUX
DOS
COMMENTS
file is.
Much more complexity
is possible in both
flavors of OS, here.
LINUX
DOS
COMMENTS
date
date, time
free, top
mem
ps -aux
tasklist
hostname
lsdev,
procinfo
LINUX
DOS
Change directory.
Store directories
for reference.
List directory
contents with
some detail.
cd
cd
cd -, pushd
pushd, popd
/path/to/target, popd
ls -l (or use ls -lF)(-a dir
all files)
List directory
contents in
compact mode.
List directory
contents, oldest
files first.
List files and size.
ls
dir /w
ls -tr
ls -ls
COMMENTS
ACTION
LINUX
DOS
COMMENTS
List size of
du -h | sort -rn, du
directory contents. -hsc * --blocksize=M
(treesize)
List directory
contents
recursively.
List including
hidden files.
Create a semigraphical "tree"
view of folders
and sub-folders.
Make a new
directory.
Create a file or
directory link.
Remove a
directory.
Display current
location.
Remove a file.
ls -R
dir /s
ls -a
dir /aa
tree
tree
mkdir
mkdir, md
ln
rmdir
pwd
chdir
rm -iv
Remove directory
and its contents.
Copy a file.
rm -R
del, erase,
rmdir /s
deltree
cp -piv
copy
Copy a directory
and all its
subcontents.
Rename or move a
file.
Show the contents
of a file.
Show the contents
of a file, one page
cp -R
xcopy
mv -iv
rename, move
cat
type
more
more
ACTION
at a time.
Sort data
alphabetically or
numerically.
Find a string in a
file.
Compare two files
and show
differences. Also
see comm, cmp,
mgdiff and tkdiff.
Set or change file
permissions.
Print a file.
Line mode editor
Edit a text file.
LINUX
DOS
sort
sort
grep
find, findstr
diff
comp, fc
chmod
attrib
lpr
print
ed
edlin
[editor] filename - edit
where editor can be filename.txt
nano, pico, vi, emacs
etc.
COMMENTS
LINUX
Backup or
Restore files.
Backup files to a
folder.
Restore files from
a folder.
Compress or
uncompress files
and folders.
DOS
COMMENTS
ACTION
LINUX
DOS
COMMENTS
source somescript, .
somescript, sh
somescript
Scheduling
ACTION
LINUX
DOS
COMMENTS
Network Commands
ACTION
LINUX
DOS
COMMENTS
ping
nslookup, dig
nbtstat
route -n
route print
Show mounted or
connected shares
and filesystems.
tracert
ipconfig,
winipcfg
Communications
ACTION
LINUX
DOS
COMMENTS
ACTION
LINUX
talk
DOS
COMMENTS
LINUX
List who is
who
logged in.
List how many who | wc -l
users are
currently logged
in.
Show the
whoami
current user
account.
Show who is
w
logged in and
what they are
doing.
Show a list of a ps -u
user's processes. account_name
DOS
COMMENTS
set
net session
(Task
Manager)