<<

or DOS Action Command -l (or use ls -lF)(-a all files) List contents ( -k Space remaining on filesystem) DIR *.* /o-d List directory contents by reverse DIR *.* / /os ls - of modification/creation. DIR /s ls -ls List files and size DIR /aa ls -R List directory/sub-directory ls -a contents recursively. List hidden files. ls -R List directory recursively cd Change directory mkdir a new directory MD ASSIGN Create a or directory rmdir Remove a directory RD CHDIR Display directory location

DEL Remove a file ERASE RMDIR /S (NT) Remove all directories and files rm -R DELTREE (Win 95...) below given directory Copy a file XCOPY cp –R Copy all file of directory recursivly RENAME or Rename/move a file contents of a file to users TYPE screen Pipe output a single page a more time or COMMAND man, Online manuals /? Clear screen ctrl-l exit Exit a EXIT0 exit 0 Look for a word in files given in command line Compare two files and show differences. Also see , , mgdiff and tkdiff. Compare two files and show diff differences. Also see comm, cmp, mgdiff and tkdiff. SET set and List all environment variables SET variable=value set Set environment variables %variable% Show environment variables export variable=value echo $variable ECHO text echo text Echo text to screen setenv (for shell) or export VAR=val (for SET variable Set environment variables Korn shell. Also VAR=val) PATH Display search for echo $PATH PATH executables. PATH=$PATH:/dir %PATH%;C:\DIR Set PATH . PROMPT $p$g export PS1='\h(\u)\> ' Set user command prompt. Show date. (also set date - DOS DATE or TIME date only) DOSKEY /h List command history DOSKEY NAME=command Set command alias NAME=command BREAK ON trap Trap ctrl-break / Trap signals. data SORT sort alphabetically/numerically Line mode editor EDIT .txt Edit a file. The editor looks like DOS edit is pico, nano, , vid probably Pico. (Not a recomendation!) files A:\ -cvf /dev/fd0 files Save files to floppy.

tar -xvf /dev/fd0 files RESTORE A:\ files Read files from floppy.

Change file permissions. DOS: ATTRIB [+r|-r] [+a|-a] +:set to -:remove r:Read only [+s|-s] [path\file] /s a:Archive s:System /s:recursively Change file to a hidden file - ATTRIB +h or -h mv file .file rename file with prefix "." PRINT lp, lpr, lpq, lpstat Print a file CALL Source (cshrc) Execute script from within batch COMMAND /C . script (bash) shell. (DOS), CMD (NT) sh script MEM free, Show free memory on system (WIN2K, -ef List executable name, ID XP) ps -aux number and memory usage of top active processes Show system info (Command MSD lsdev borrowed from AIX) SCANDISK Check and repair hard drive file DEFRAG C: debugfs system CHDISK Disk usage. fdisk Tool to partition a hard drive. a drive letter to a SUBST V: mount folder/directory on your hard C:\directory\path drive. –t filesystemtype Format drive .

VER -a /shell version and uncompress files/directories. Use tar to create tar -z and gzip compilation of a directory before compressing. hostname Print name of PING / PATHPING ping Send packets to a network host Show routes and router hops to TRACERT given network destination. (NT) Display/configure network WINIPCFG (Win interface 95...) /HOST NBTSTAT (Netbios info: -n, -c) nslookup host-name NBTSTAT -a host- Print DNS info for host. host host-name name NBTSTAT -A IP- address PRINT route –n, -rn Print routing table. HELP chkconfig --list |grep on List services. NET STARTservice- service service-name name start/stop Start/stop service/. NET STOPservice- name Show mounted NET SHARES df shares/filesystems. smbclient -M MS- Send pop-up to a MS/Windows NET SEND Send message to another (NT) Unix/Linux user. WIN startx Start X-Windows. REBOOT -r now Reboot system.