1 / 42

Common DOS Commands

Common DOS Commands. Additional information. Important DOS Concepts Common DOS Commands. Why format a disk? Partitioning and Formatting disks Structure of a disk Physical structure of a disk Logical structure of a disk File System Formats Backing up Files Overwriting Files

Download Presentation

Common DOS Commands

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Common DOS Commands Additional information

  2. Important DOS ConceptsCommon DOS Commands • Why format a disk? • Partitioning and Formatting disks • Structure of a disk • Physical structure of a disk • Logical structure of a disk • File System Formats • Backing up Files • Overwriting Files • Making Exact Copies of Files CTEC 110

  3. Important DOS CommandsCommon DOS Commands • FORMAT • LABEL • VOL • MOVE • DIR • CHKDSK • TYPE • COPY • DEL • RENAME CTEC 110

  4. Why Format a Disk? • Disks used for: • Permanent storage of data and programs • Distributing data from one computer to another • Making copies • Formatting (initializing) the disk: • Process of preparing disk so that it is compatible with an operating system • All disks (including hard disks) can be formatted. • All information on disk will be erased CTEC 110

  5. Partitioning and Formatting Disks • Hard disks must be: • Partitioned • Formatted with file system • Types of disk storage configuration: • Basic disks • Dynamic disks CTEC 110

  6. Partitioning and Formatting Disks • Windows supports four file systems: • NTFS • Plus three FAT file systems • FAT12 • FAT16 • FAT32 CTEC 110

  7. Structure of a Disk • Two parts to formatting a disk: • Low-level (physical) formatting • High level (logical) formatting • Low-level (physical) formatting: • Sequentially numbers tracks and sectors • Identifies each track and sector • Disk is physically prepared to hold data • High-level (logical) formatting: • Determines how OS uses a disk • Builds structure to keep track of location of files • Done so files can be stored and retrieved. CTEC 110

  8. Structure of a Disk • Windows will monitor the status of all data sectors • One or more sectors are combined into logical units called clusters or allocation units CTEC 110

  9. Physical StructureTrack, Sector, & Cluster CTEC 110

  10. Logical StructureMaster Boot Record & Boot Sector • Master boot record (MBR): • First part of hard disk • Locates bootable partition of hard disk and gives control over to it • Boot sector: • First sector on logical drive • Has table of drive’s characteristics • Has bootstrap loader program • All disks (including non-system disks) have a boot sector. CTEC 110

  11. Logical Structure CTEC 110

  12. Logical StructureFAT and the Root Directory • FAT tracks “where” data is on the disk • FAT – File Allocation Table • A table that tracks the physical clusters • Root directory tracks “what” is on the disk. • Root Directory: • A table that tracks file information CTEC 110

  13. File System FormatsFAT16, VFAT & FAT32 • FAT essential for: • Managing data • Following trail of clusters that make up a file • VFAT maintains • backwards compatibility and • accommodates long file names • FAT32: • Enhancement of FAT file system • Introduced to overcome limitations of VFAT CTEC 110

  14. FAT32 • FAT32: • Movable Root Directory • Can be located anywhere on hard disk • NOTE: For disk security, performance, and efficiency use the NTFS file system CTEC 110

  15. NTFS • Advantages of NTFS: • Secure file system • Efficient storage of data • Faster file access • Better data recovery • Can compress files/assign disk quotas • Encryption of files CTEC 110

  16. NTFS • NTFS: • Uses FAT cluster scheme for allocating data. • Has less overhead. CTEC 110

  17. Master File Table (MFT) • Master File Table (MFT): • Database of all files in system • Used by NTFS to track all files and directories in a volume • Dynamic • MFT is different from FAT. CTEC 110

  18. File System Format Notes • You can convert FAT to FAT32/NTFS • You CANNOT convert FAT32/NTFS to FAT • Make use of the NTFS file system for disk security, performance, and efficiency CTEC 110

  19. Backing Up Files • Application programs can usually be reinstalled from original disks. • You may want to take snapshots or backup the configuration of yor programs for quicker recovery • Always keep track of any special licensing tricks you need to do CTEC 110

  20. Backing Up Files • DOS has three ways to back up data files: • DISKCOPY – (floppy drives) • COPY • XCOPY CTEC 110

  21. Backing Up Files • Develop a regular backup routine. • You use “tape backup” • You can use writable CDs • You can use “external drives” CTEC 110

  22. Backing Up Files • Notes on the Backup disk • Keep current • Have two or more • Check your backups with restore regularly • Some organizations need to recreate records • Need archival backup • Need transaction history CTEC 110

  23. Backing Up Files • Do regular backups: • Back up files that have changed or are new • Reasons for copying files: • Copy files from one disk to another • Making changes of existing file • Create backup copy of various data files CTEC 110

  24. Overwriting Files • The file must have a unique name on same disk and subdirectory • Old data replaced by new data • Overwrite files on regular basis as you want to backup files • Windows will inform the user that an overwrite will occur CTEC 110

  25. Overwriting Files • Concatenation is creating another file by combining the contents of two or more text (ASCII) files • Concatenation should never be done with program files, or with data files generated by programs • To avoid accidental concatenation of files, read all messages DOS displays on the screen • COPY FILE1 + FILE2 NEWFILE • COPY *.TXT ALLFILES CTEC 110

  26. Exact Copy of Files • You can have two files with identical contents on same disk • However there are some restrictions… • For the same name • Use different subdirectories • For the same subdirectory • Use different file names CTEC 110

  27. A Review on Some Commands FORMAT formats drive LABEL labels drive VOL list volume label on drive COPY copies files XCOPY copies files TYPE display the contents of files DEL deletes files REN rename files MOVE move files DATE set the date TIME set the time UNDELETE undelete a file CTEC 110

  28. The FORMAT command • The FORMAT command syntax: FORMAT volume [/FS:file-system] [/V:label] [/Q] [/A:size] [/C] [/X] [/P:passes] [/S:state] FORMAT volume [/V:label] [/Q] [/F:size] [/P:passes] FORMAT volume [/V:label] [/Q] [/T:tracks /N:sectors] [/P:passes] FORMAT volume [/V:label] [/Q] [/P:passes] FORMAT volume [/Q] CTEC 110

  29. The FORMAT command • Use /V: switch for the volume label • No spaces between the colon and label • Use /Q switch for a quick format • Fast way to clear previously formatted disks • Works like the usual FORMAT command • Skips low level formatting • Clears the FAT and root tables • Does not check for bad sectors • Examples: • FORMAT A: /V:FLOPPY1 • FORMAT C: /Q • FORMAT Z: /FS:FAT • FORMAT U: /FS:FAT32 CTEC 110

  30. The LABEL Command • The LABEL command syntax: LABEL [drive:] [label] • Creates, changes or deletes the volume label of a disk • Example: • LABEL A: OLDNAME • LABEL A: NEWNAME • LABEL A: Input volume label - Up to 11 characters.Press ENTER only to delete label. CTEC 110

  31. The VOL Command • The VOL command syntax: VOL [drive:] • Displays the disk volume label, if any • Example: • VOL Z: Volume in drive Z is USB_DISK_02 Volume Serial Number is 64B8-54F3 CTEC 110

  32. The COPY Command • The COPY command syntax: COPY [/D] [/V] [/N] [/Y | /-Y] [/Z] [/L] [/A | /B ] source [/A | /B] [+ source [/A | /B] [+ ...]] [destination [/A | /B]] • Copies one or more files to another location • Can be used to combine file contents • Examples: • copy c:\Windows\System32\cmd.exe c:\ CTEC 110

  33. The XCOPY Command • The XCOPY command syntax: XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W] [/C] [/I] [/Q] [/F] [/L] [/G] [/H] [/R] [/T] [/U] [/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z] [/B] [/EXCLUDE:file1[+file2][+file3]...] • Has the capability of moving files, directories, and even whole drives from one location to another • The /S switch copies subdirectories and files • The /E switch copies empty subdirectories • Examples: • XCOPY c: a: /s • XCOPY n:\*.* o:\ /e CTEC 110

  34. The TYPE Command • The TYPE command syntax: TYPE [drive:] [path] filename • Internal command • Opens/displays contents of file on screen • Must be a text/ASCII file for the display to be meaningful and readable • Example: • TYPE z:\ctec110\breakusb.bat • TYPE o:\name.bat CTEC 110

  35. The DEL Command • The DEL command syntax: DEL [/P] [/F] [/S] [/Q] [/A [[:] attributes]] [drive:] [path] filename ERASE [/P] [/F] [/S] [/Q] [/A [[:] attributes]] [drive:] [path] filename • Used to remove files from the disk • Files are generally not recoverable • The /P switch will ask to confirm deletion • The /S switch will delete files in the subdirectories • Examples: • DEL TEST.TXT • DEL /p c:\Part* • DEL /s p:\*.* (Directories will require confirmation) CTEC 110

  36. The RENAME command • The RENAME command syntax: RENAME [drive:][path]filename1 filename2 REN [drive:][path]filename1 filename2 • Renames a file or files • You cannot specify a new drive or path for your destination file • Examples: • REN test testing • REN testing test CTEC 110

  37. The MOVE command • The MOVE command syntax: MOVE [/Y | /-Y] [drive:][path]filename1[,...] destination MOVE [/Y | /-Y] [drive:][path]dirname1 dirname2 • Can be used to rename a file or directory • Examples: • move c:\windows\web c:\web2 • move c:\web2 c:\web3 CTEC 110

  38. The MOVE command • There are some restrictions… • When moving group of files you cannot change the names • When moving an individual file/subdirectory you can change the name • You can move files/directories from one directory to another and from one drive to another CTEC 110

  39. The DATE command • The DATE command syntax: DATE [/T | date] • Displays or sets the date • Requires Administrator rights to change • Type DATE without parameters to display the current date setting and to prompt for a new one • Press ENTER to keep the same date • Use /T switch to skip the prompting for a new date • Examples: • DATE • DATE /T • DATE 05-22-13 (Set the date to May 22nd, 2013) • DATE 05.22.13 • DATE 05/22/13 CTEC 110

  40. The TIME command • The TIME command syntax: TIME [/T | time] • Displays or sets the system time • Requires Administrator rights to change • Type TIME with no parameters to display the current time setting and a prompt for a new one • Press ENTER to keep the same time • Use /T switch to skip the prompting for a new time • Examples: • TIME • TIME /T • TIME 15:22 (Set the time to 3:22 pm) CTEC 110

  41. The UNDELETE command • The UNDELETE command syntax: UNDELETE [d:][path][filename] [/DT|/DS|/DOS]UNDELETE [/list|/all|/purge[d:]|/status|/load|/U|/S[d:]|/Td:[-entries]] • Has been removed from current Windows OS versions • Restores files deleted with the DELETE command • Removes the first character of the file • Requires user to supply first character of the file upon undelete • Examples: • UNDELETE \letters\*.* /all • (Recover all files in the letters directory) • UNDELETE /dt • (Recover files in current directory using the delete-tracking file) CTEC 110

  42. END of Addition Information • HOMEWORK • Lab 2 • DOS Quiz 2 CTEC 110

More Related