Professional Documents
Culture Documents
DOS Command DIR UNIX or Bash Command ls -l (or use ls -lF)(-a all files) (df -k Space remaining on filesystem) ls -tr ls -ls ls -R ls -a Action List directory contents
TREE CD MKDIR MD ASSIGN RMDIR RD CHDIR DEL ERASE RMDIR /S (NT) DELTREE (Win 95...) COPY XCOPY RENAME or MOVE TYPE MORE HELP or COMMAND /? CLS EXIT EXIT0 FIND FINDSTR COMP FC SET SET variable=value echo %variable%
ls -R cd mkdir ln rmdir pwd rm -iv rm -R cp -piv cp -R mv -iv cat more man clear ctrl-l exit exit 0 grep diff diff set and env set export variable=value
List directory contents by reverse time of modification/creation. List files and size List directory/sub-directory contents recursively. List hidden files. List directory recursivly Change directory Make a new directory Create a file or directory link Remove a directory Display directory location Remove a file Remove all directories and files below given directory Copy a file Copy all file of directory recursivly Rename/move a file Dump contents of a file to users screen Pipe output a single page at a time Online manuals Clear screen Exit a shell Look for a word in files given in command line Compare two files and show differences. Also see comm, cmp, mgdiff and tkdiff. Compare two files and show differences. Also see comm, cmp, mgdiff and tkdiff. List all environment variables Set environment variables Show environment variables
PATH PATH %PATH%;C:\DIR PROMPT $p$g DATE or TIME DOSKEY /h DOSKEY NAME=command BREAK ON SORT EDLIN EDIT filename.txt
echo $variable echo text setenv (for C shell) or export VAR=val (for Korn shell. Also VAR=val) echo $PATH PATH=$PATH:/dir export PS1='\h(\u)\W> ' date history alias NAME=command trap sort ed pico, gnp, vi, xedit, xemacs,dtpad tar -cvf /dev/fd0 files mdir, mcopy doswrite -a file (AIX only) tar -xvf /dev/fd0 files mdir, mcopy dosread -a file (AIX only) chmod
Display search path for executables. Set PATH environment variable. Set user command prompt. Show date. (also set date - DOS only) List command history Set command alias Trap ctrl-break / Trap signals. Sort data alphabetically/numerically Line mode editor Edit a file. The Linux editor which looks most like DOS edit is probably Pico. (Not a recomendation!) Save files to floppy. See Using DOS floppies
Read files from floppy. See Using DOS floppies Change file permissions. DOS: +:set to :remove r:Read only a:Archive s:System /s:recursively Change file to a hidden file - rename file with prefix "." Print a file Execute script from within batch shell.
ATTRIB [+r|-r] [+a|a] [+s|-s] [path\file] /s ATTRIB +h or -h PRINT CALL COMMAND /C (DOS), CMD (NT) MEM TASKLIST (WIN2K, XP) MSD SCANDISK DEFRAG C: CHDISK FDISK SUBST V:
mv file .file lpr source script (cshrc) . script (bash) sh script free top ps -aux top lsdev fsck debugfs du -s fdisk mount
Show free memory on system List executable name, process ID number and memory usage of active processes Show system info (Command borrowed from AIX) Check and repair hard drive file system Disk usage. Tool to partition a hard drive. Mount a drive letter to a folder/directory
C:\directory\path FORMAT
VER
pkzip
mke2fs See: fdformat and mformat for floppies uname -a echo $SHELL cat /etc/issue tar and zip
on your hard drive. Format drive file system. For floppy drive use see YoLinux Tutorial Using DOS Floppies with Linux Operating system/shell version
HOSTNAME PING TRACERT IPCONFIG (NT) WINIPCFG (Win 95...) NBTSTAT (Netbios info: -n, -c) NBTSTAT -A IPaddress NBTSTAT -a hostname ROUTE PRINT NET HELP START NET STARTservicename NET STOPservicename NET SHARES NET SEND <nodename> <message> (NT) WIN REBOOT
Compress and uncompress files/directories. Use tar to create compilation of a directory before compressing. Linux also has compress, gzip Print host name of computer Send packets to a network host Show routes and router hops to given network destination. Display/configure network interface
nmblookup -A hostname route -n chkconfig --list |grep on service service-name start service service-name stop
lookup NetBIOS names. Print routing table. List services. Start/stop service/daemon.
Show mounted shares/filesystems. Send pop-up to a MS/Windows PC Send message to another Unix/Linux user. See YoLinux tutorial Start X-Windows. 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 \ .\ ..\ ctrl-z ctrl-c * ? %VAR% %1 %2 %3 / | > >> < / ./ ../ ctrl-d ctrl-c * ? $VAR $1 $2 $3 | > >> < UNIX or Bash Descriptor/Operator Description Directory path delimiter Current directory Parent directory End of file/close shell Interrupt/process break file name wild card Single character wild card Variable prefix First, second and third shell command line arguments. Command line option flag prefix Pipe stdout redirection stdout redirection overwrite stdin redirection
... IF EXIST C:\filename elif ...; then ... IF NOT EXIST else C:\filename ... fi if [ -e /dir/filename ]; then if [ ! -e /dir/filename ]; then GOTO ABC ... :ABC FOR ... IN ... DO FOR %%fff IN (C:\dir\*.*) DO echo %%fff goto ABC ... :ABC
Branch
for ffiillee in lliisstt; For loop do ...; done for (( expr1; expr2; expr3; )) do ...; done $? sleep exit status/return code sleep for specified interval
ERRORLEVEL PAUSE
Devices:
DOS Device Linux Device Description NUL /dev/null Send into nothingness CON PRN LPT1 COM1 stdin /dev/lp0 /dev/ttyS0 stdin from console First printer device Firsst serial port
oowriter oocalc ooimpress acroread tuxpaint xfig gimp file-roller ksysguard qps gnome-systemmonitor xosview
Adobe PDF viewer Graphics and painting program File compress / decompress / pack / unpack Process and system load monitor
Links: