Skip to main content

Command Comparison between DOS & Linux/Unix

Command Comparison:

DOS Command UNIX or Bash Command Action
DIR ls -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 ls -R List directory recursivly
CD cd Change directory
mkdir Make a new directory
ASSIGN ln Create a file or directory link
rmdir Remove a directory
CHDIR pwd Display directory location
rm -iv Remove a file
DELTREE (Win 95...)
rm -R Remove all directories and files below given directory
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
CLS clear
Clear screen
exit 0
Exit a shell
grep Look for a word in files given in command line
COMP diff Compare two files and show differences. Also see comm, cmp, mgdiff and tkdiff.
FC diff 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
echo $PATH
Display search path for executables.
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 NAME=command alias NAME=command Set command alias
BREAK ON trap Trap ctrl-break / Trap signals.
SORT sort Sort data alphabetically/numerically
EDLIN ed Line mode editor
EDIT filename.txt pico, gnp, vi, xedit, xemacs,dtpad Edit a file. The Linux editor which looks most like DOS edit is probably Pico. (Not a recomendation!)
BACKUP files A:\ tar -cvf /dev/fd0 files
mdir, mcopy
doswrite -a file (AIX only)
Save files to floppy.
See Using DOS floppies
RESTORE A:\ files tar -xvf /dev/fd0 files
mdir, mcopy
dosread -a file (AIX only)
Read files from floppy.
See Using DOS floppies
ATTRIB [+r|-r] [+a|-a] [+s|-s] [path\file] /s chmod 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 lpr Print a file
source script (cshrc)
. script (bash)
sh script
Execute script from within batch shell.
MEM free
Show free memory on system
TASKLIST (WIN2K, XP) ps -aux
List executable name, process ID number and memory usage of active processes
MSD lsdev Show system info (Command borrowed from AIX)
Check and repair hard drive file system
CHDISK du -s Disk usage.
FDISK fdisk Tool to partition a hard drive.
SUBST V: C:\directory\path mount Mount a drive letter to a folder/directory on your hard drive.
FORMAT mke2fs
See: fdformat and mformat for floppies
Format drive file system.
For floppy drive use see YoLinux Tutorial Using DOS Floppies with Linux
VER uname -a
echo $SHELL
cat /etc/issue
Operating system/shell version
pkzip tar and zip Compress and uncompress files/directories. Use tar 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
TRACERT traceroute Show routes and router hops to given network destination.
WINIPCFG (Win 95...)
ifconfig Display/configure network interface
NBTSTAT (Netbios info: -n, -c)
NBTSTAT -A IP-address
nslookup host-name
host host-name
Print DNS info for host.
NBTSTAT -a hostname nmblookup -A hostname lookup NetBIOS names.
ROUTE PRINT route -n Print routing table.
NET HELP START chkconfig --list |grep on List services.
NET STARTservice-name
NET STOPservice-name
service service-name start
service service-name stop
Start/stop service/daemon.
NET SHARES df Show mounted shares/filesystems.
NET SEND <node-name> <message> (NT) smbclient -M MS-Windows-host-name
Send pop-up to a MS/Windows PC
Send message to another Unix/Linux user. See YoLinux tutorial
WIN startx Start X-Windows.
REBOOT shutdown -r now Reboot system.

To find out how to do something on UNIX simply type "man -k subject_matter". This will do a key word search for all commands dealing with the subject matter. Then use the appropriate command. Online manuals are available on all the commands by typing "man command_name". MS/Windows info:

Shell Descriptor/Operators:

DOS Descriptor/Operator UNIX or Bash Descriptor/Operator Description
\ / 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
%1 %2 %3 $1 $2 $3 First, second and third shell command line arguments.
/ - Command line option flag prefix
| | Pipe
> > stdout redirection
>> >> stdout redirection overwrite
< < stdin redirection

Shell Script Operators:

DOS Operator UNIX or Bash Operator Description
set +v Set verbose mode off. -v: Echo each line of shell script as it is executed.
% $ command line argument prefix. DOS: %1 Bash: $1 for firs argument.
REM # Comment. (Not processed.)
== = string "equal to" comparison
!==! != string "not equal to" comparison
NOT ! negative of test expression
CHOICE case case/switch statement
IF IF EXIST C:\filename
IF NOT EXIST C:\filename
if [[ test-resulting-in-bool ]];
elif ...;
fi if [ -e /dir/filename ];
if [ ! -e /dir/filename ];
if-test If file exists
If file does not exist.
goto ABC
FOR ... IN ... DO FOR %%fff IN (C:\dir\*.*)
DO echo %%fff
for ffiillee in lliisstt;
do ...;
done for (( expr1; expr2; expr3; ))
do ...;
For loop
ERRORLEVEL $? exit status/return code
PAUSE sleep sleep for specified interval

Bash shell aliases for DOS users:
The following are bash shell aliases which can be added to the system profile or the user's personal profile ($HOME/.bashrc) to correct and help DOS users on Linux.
alias dir="echo 'Use the command: ls -lF'"
alias tree="echo 'Use the command: ls -R'"
alias del="echo 'Use the command: rm -iv'"
alias move="echo 'Use the command: mv -iv'"
alias rename="echo 'Use the command: mv -iv'"
alias copy="echo 'Use the command: cp -piv'"
alias type="echo 'Use the command: cat'"
alias cls="echo 'Use the command: clear'"
alias mem="echo 'Use the command: free'"
alias ver="echo 'Use the command: uname -a'"
alias A:="echo 'Use the command: mdir a:'"
alias a:="A:"
alias C:="echo 'No C drive in Linux. Go to your home directory with the command: cd'"
alias c:="C:"


DOS Device Linux Device Description
NUL /dev/null Send into nothingness
CON stdin stdin from console
/dev/lp0 First printer device
COM1 /dev/ttyS0 Firsst serial port

Equivalent Linux and MS/Windows GUI Applications:

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


Post a Comment

Popular posts from this blog

Port forward of KVM Guest Virtual Machine through Host Machine using IPTABLE/FIREWALL in Linux System

Port forward of KVM Guest Virtual Machine through Host Machine using IPTABLE/FIREWALL in Linux System
There is a lot of method given in Internet for KVM guest machine port forwarding but I always look for the simple solution that can work in any Linux System.

I have issue during the port forward by IPTABLE/FIREWALL as it disable the Internet access within KVM guest machine.
If I look for Internet access within KVM guest machine then system disable port forwarding.

I have implement the simple solution in CentOS 6.5 x86_64 with can work in both situation as follows:

Step 1: Restart libvirtd service, so that it will modify your firewall rules as per KVM requirement.
# service libvirtd restart
Step 2: You need to add two rules in IPTABLE for NAT and FILTER
# iptables-save > iptable_save_default_libvirtd
# cp iptable_save_default_libvirtd iptable_modifed_libvirtd
# vim  iptable_modifed_libvirtd

Add line after *nat for SSH access

 -A PREROUTING -i eth0 -p tcp -m tcp --dport 222 -j DNA…

AMD Graphic Driver (Radeon 6400 series) Install on Linux CentOS-6.2 x86_64 bit

Add-on in Dell vostro 3350 laptop for AMD Catalyst™
driver Radeon HD 6400 series graphic card in CentOS 6.2 x86_64 Linux
Step1: Update the CentOS with following packages
# yum install kernel-devel kernel-headers gcc gcc-c++

Now download the driver from the amd site

Step2: Now install AMD Graphic driver

Step3: check log file
#vim /usr/share/ati/fglrx-install.log

there will be an error like this

"ERROR: Module drm is in use by i915,drm_kms_helper"
"You must change your working directory to /lib/modules/fglrx
and then call ./ in order to install the built module."

You can ignore these lines happily if they don’t contain any error message. You don’t really need to execute the command mentioned in those lines.

Step4: Blacklist radeon and radeonhd kernel modules

Add these lines to /etc/modprobe.d/blacklist.conf.

blacklist radeon
blacklist radeo…

Yum command for download list of packages

Some time we need the download the software but not to install.
Also we have a list of software from repository in a text file but need to download by the yum.
To solve this kind of problem we need some trick of Linux,
download the package yum-downloadonly plugin
create a text file with rpm name.
now parse it to yum command
#yum install $(cat rpm-list.txt)

to download only the packages
#yum install <package name> --downloadonly --downloaddir=/home/user/

combine command
# yum install  $(cat rpm-list.txt) --downloadonly --downloaddir=/home/user

create a list from yum.log
#cp /var/log/yum.log /home/user/yum.log

select the package name only
# awk '{print $5}' /home/user/yum.log > rpm-list.txt

view the list
# cat rpm-list.txt

 to query about a package
# repoquery --list <package name>

to take information about package
#yum info <package name>

to show the list of packages
# yum list

to find a package for yum list
# yum list | grep <package name>