Monday, November 23, 2009

UNIX vs DOS

Most of Linux beginner seems to be confused where to start. Especially for Windows user who want to make a migration. Well, maybe this can help...

Linux commands are mostly similar to UNIX commands. So, if user already familiar with UNIX, this won't be really matter. But what about the Microsoft's user who want to migrate? This table contents the comparation between UNIX and DOS commands. Note that the default shell is BASH (Bourne Shell).

DOS Command
UNIX / Linux
Description
dir
ls

List the directory contents
tree
ls -R
List directory recursively (tree form)
cd
cd
Change directory
mkdir
mkdir
Make a new directory
assign
ln
Create a file or directory link
rmdir
rmdir
Remove a directory
chdir
pwd
Prints current working directory
del
erase
rm
Remove a file
deltree
rm -R
Remove all directories and files recursively
copy
cp
Copy a file
xcopy
cp -R
Copy all file of directory recursivly
rename
move
mv
Rename / move a file
Note: mv has ability to rename/ move a directory
type
cat
Dump contents of a file to standard output
help
man
Online manuals
cls
clear
(hotkey: ctrl+l)
Clear screen
find
findstr
grep
Look for a word in files given in filter
comp
diff
Compare two files and show differences
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
date
time
date
Show date
break on
trap
Trap ctrl-break / Trap signals.
attrib [+r|-r] [+a|-a] [+s|-s] [path\file] /s
chmod
Change file permissions.
subst v: C:\directory\path
mount
Mount a drive letter to a folder/directory on your hard drive.
hostname
hostname
Print host name of computer
ping
ping
Send packets to a network host
tracert
traceroute
Show routes and router hops to given network destination.
win
startx
Start X-Windows.
reboot
shutdown -r now
Reboot system.

For more information about the command, Linux always include the manual. The manual is very helpful. By typing:
man command
the output (screen) will display the manual page of the command we need to obtain.

Labels: