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] /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
CALL
COMMAND /C (DOS), CMD (NT) source script (cshrc)
. script (bash)
sh script Execute script from within batch shell.
MEM free
top Show free memory on system
TASKLIST (WIN2K, XP) ps -aux
top List executable name, process ID number and memory usage of active processes
MSD lsdev Show system info (Command borrowed from AIX)
SCANDISK
DEFRAG C: fsck
debugfs 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.
IPCONFIG (NT)
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
talk 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:
http://www.mcmcse.com/
http://www.techtutorials.net/
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
@
ECHO OFF 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 ]];
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
分享到:
相关推荐
Installation goes in the following simple... For MSVC users only: Set up your environment so that MSVC can be used from the commandline. You probably have a vcvars32.bat file that will do this for you.
Java程序启动的外部进程可以通过`Process`对象进行控制,例如通过`destroy()`方法终止进程,或者通过`waitFor()`方法等待进程结束。 6. **安全考虑**: 调用DOS命令时要谨慎,因为这可能导致安全风险。不要执行...
Users who come from other operating systems like Unix or VMS and think it is unnecessary to do everything with a GUI interface. Users who want to automate tasks like password changing in a batch file ...
Python3支持多种平台,包括但不限于Windows、Linux、MacOSX、Unix变体(如Solaris、FreeBSD、AIX等)、Macintosh、OS/2、DOS、PalmOS、Nokia移动手机、WindowsCE、Acorn/RISCOS、BeOS、Amiga、VMS/OpenVMS、QNX、...
集合了 所有的 Unix命令大全 登陆服务器时输入 公帐号 openlab-open123 telnet 192.168.0.23 自己帐号 sd08077-you0 ftp工具 192.168.0.202 tools-toolss 老师测评网址 http://172.16.0.198:8080/poll/ 各个 ...
操作系统有哪些 操作系统是计算机系统的核心组件之一,负责管理计算机硬件资源、提供用户界面... Understanding the different types of operating systems is essential for computer users and professionals alike.
4.1 NOTES FOR VERSION 1.0 & 1.5 USERS ------------------------------------- o You must use the Version 2.0 or 2.01 libraries with the 2.01 compilers. o The Integrated Development Environment no...
Autodetect line break styles (DOS, UNIX or Mac), and convert them.• Convert between different codepages (KOI8-R, ISO 8859, DOS, Mac).• Print and print preview with syntax highlight in ...
5.1 NOTES FOR VERSION 1.0 & 1.5 USERS ------------------------------------- o You must use the Version 2.0 libraries with the 2.0 compilers. o The Integrated Development Environment no longer ...
`display charset` 和 `unix charset` 分别指定了显示和系统字符集编码为 UTF-8,而 `dos charset` 设置了 DOS 文件名编码为 `cp936`,这样可以更好地支持中文环境下的文件名显示。 #### 五、添加用户账号 为了实现...
Microsoft FTP7.5 for IIS7.x 是微软提供的一个FTP服务组件,用于在IIS7.x环境下提供FTP服务。在实际使用中,可能会遇到各种问题,以下是一些常见问题及解决方法。 1. **FTP站点建立和设置**: - 在IIS管理器中,...
The goal of this guide is to manage this complexity by describing in detail the dos and don'ts of writing C++ code. These rules exist to keep the code base manageable while still allowing coders to ...
- **unix**: 执行UNIX命令,如`unix('ls -l')`。 #### 特殊操作命令 - **diary**: 记录MATLAB会话,可以将MATLAB命令及其结果记录到文本文件中,便于以后查看。 - **cedit**: 设置编辑器选项。 - **clc**: 清除...
- **功能**: 执行DOS或UNIX操作系统命令。 - **用法**: `!命令`,例如:`!dir` 或 `!ls -l`。 **diary** - **功能**: 记录MATLAB会话到文件。 - **用法**: `diary 文件名` 或 `diary on` 开始记录;`diary off` ...
第1章 Red Hat Linux和UNIX简介 1 1.1 Linux的优点 2 1.2 版权和保证 3 1.3 在哪里可以获取Red Hat Linux 3 1.4 系统需求 3 1.5 小结 4 第2章 Red Hat系统的安装 5 2.1 准备,认真准备 5 2.2 安装Red Hat Linux 6 ...