UNIX For DOS Users

http://www.yolinux.com/TUTORIALS/unix_for_dos_users.html

http://blog.chinaunix.net/uid-20740995-id-750190.html


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
MD mkdir Make a new directory
ASSIGN ln Create a file or directory link
RMDIR
RD rmdir Remove a directory
CHDIR pwd Display directory location
DEL
ERASE rm -iv Remove a file
RMDIR /S (NT)
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
ctrl-l Clear screen
EXIT
EXIT0 exit
exit 0 Exit a shell
FIND
FINDSTR 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
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 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][ test-resulting-in-bool ];
then
...
elif ...;
then
...
else
...
fi
if [ -e /dir/filename ];
then

if [ ! -e /dir/filename ];
then

if-test
If file exists

If file does not exist.

GOTO ABC
...
:ABC goto ABC
...
:ABC Branch
FOR ... IN ... DO
FOR %%fff IN (C:\dir\*.*)
DO echo %%fff

for ffiillee in lliisstt;
do ...;
done
for (( expr1; expr2; expr3; ))
do ...;
done

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:"
Devices:
DOS Device Linux Device Description
NUL /dev/null Send into nothingness
CON stdin stdin from console
PRN
LPT1 /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
konsole Command Text Terminal
C:\WINDOWS\explorer nautilus --no-desktop File browser
c:\Program Files\Internet Explorer\iexplore firefox
mozilla Web browser
C:\WINDOWS\notepad
C:\Program Files\Windows NT\Accessories\wordpad gedit Text editor
C:\Program Files\Microsoft Office\Office10\winword
excel
powerpnt oowriter
oocalc
ooimpress MS/Office and Open Office suites (ooffice)
C:\Program Files\Adobe\Acrobat 7.0\Reader\acrord32 acroread Adobe PDF viewer
mspaint tuxpaint
xfig
gimp Graphics and painting program
C:\Program Files\WinZip\winzip32 file-roller File compress / decompress / pack / unpack
taskmgr ksysguard
qps
gnome-system-monitor
xosview Process and system load monitor
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值