1 DOS 2 Directory structure of disks Directory structure of disks Full Path or Full file specification Full Path or Full file specification Creating directories.

Slides:



Advertisements
Similar presentations
DOS commands.
Advertisements

DOS & Windows O/s Prof. Sujata Rao Less 5.
Operating System Type of Operating System
A+ Guide to Software, 4e Chapter 6 Windows 9x/Me Commands and Startup Disk.
Disk Operating System (DOS)
DIR : Displays a list of files and subdirectories in a directory. Syntax: DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N] /P.
MCT260-Operating Systems I Operating Systems I Navigating the File System.
© 2007 The McGraw-Hill Companies, Inc. All rights reserved Working with the Command- Line Interface Chapter 14.
Chapter 5 Accessing Files and Directories. How Directories Get Created OS installation: usr, dev, etc, export, kernel and others places to store installation.
Micro Op SYS (DOS) Chapters 1, 2, 3, 5, 6, 7. 2 Hardware Four Categories –CPU (Central Processing Unit) –Primary Storage (RAM) –Input/Output Devices Keyboard.
1 Windows Command Line Interface (AKA DOS commands) Prof. Yitzchak Rosenthal.
Command Console Tutorial BCIS 3680 Enterprise Programming.
FILES  A file is a collection of related information  Files are kept in directories on a disk.
Operating System Fundamentals
© 2010 The McGraw-Hill Companies, Inc. All rights reserved Mike Meyers’ CompTIA A+ ® Guide to Managing and Troubleshooting PCs Third Edition Working with.
© 2013 The McGraw-Hill Companies, Inc. All rights reserved Mike Meyers’ CompTIA A+ ® Guide to 802: Managing and Troubleshooting PCs Fourth Edition (Exam.
Or CMD/BATCH.  Title this comand makes the cmd prompt’s title whatever you would like it to be.
1 Lab 1-1 Using the Command Line Copyright © 2006 Heathkit Company, Inc. All Rights Reserved.
© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 1 Third Edition Chapter 4 Disk Operating System (DOS) and the Command-Line Interface McGraw-Hill.
Ch 71 Using ATTRIB, SUBST, XCOPY, DOSKEY, and the Text Editor.
By Umesh ks. Dos is a single user operating system. Its support the all operating system wizards Support the disk scheduling. File management Network.
Ch 51 Internal Commands COPY and TYPE. Ch 52 Overview Will review file-naming rules.
Chapter Five Maintaining a Computer Part III: File and Folder Management.
DOS Commands What is a command Types of DOS Commands Basic Terms
Ch 61 Using DEL, REN, MOVE, and RD /S. Ch 62 Overview Will continue to work with internal commands that help manage and manipulate files.
Chapter 6: Managing Your Data The Windows XP File System File system task on DOS or UNIX Vs. Windows XP –cd or chdir would change your current directory.
Using Hard Drives Additional information.  Hierarchical Filing Systems  Why Organize a Hard Disk?  Relative and Absolute Paths  Subdirectory Markers.
1 THE UNIX FILE SYSTEM By Chokechai Chuensukanant ID COSC 513 Operating System.
Lesson 7-Creating and Changing Directories. Overview Using directories to create order. Managing files in directories. Using pathnames to manage files.
Chapter 9 Part II Linux Command Line Access to Linux Authenticated login using a Linux account is required to access a Linux system. The Linux prompt will.
Operating System Basics Chapter 1 Release 16/07/20 09 powered by dj.
Understanding the Boot Process and Command Line
Ch 21 Command Syntax Using the DIR Command with Parameters and Wildcards.
Gene Perkins, Lassen High School Networking Academy
®® Microsoft Windows 7 for Power Users Tutorial 13 Using the Command-Line Environment.
Ch 41 Program Files, Data Files, and Subdirectories.
The Command Line Mostly MS Dos with some UNIX/LINUX Copyright © Curt Hill.
Managing Files. Module 5 Managing Files ♦ Introduction “On a Linux system, everything is a file; if something is not a file, it is a process.” ♦ Topics.
BY PREETHI DOS INTERNAL COMMANDS. INTERNAL COMMANDS  DOS commands that are present in the COMMAND.COM file and are automatically loaded into RAM when.
BIF713 Basic Unix/Linux Commands Getting Help with Commands.
Chapter Two Exploring the UNIX File System and File Security.
Basic MS-DOS. History MS-DOS 1.0 was released in August 1981, and was updated until April 1994 when it was replaced by Windows 95 All versions of windows.
Chapter 1 : The Linux System Part 2 Lecture 2 11/14/
1.  Microsoft DOS (Disk Operating System) use a command line user interface.command line  A command line user interface means that the user is required.
Lab Assignment 1 Getting Started. Submitting the LABS for grading Subject line of message: CTEC 110 WA Lab 1 Assignments Attachment file names:
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: whereis, which, whoami, finger, passwd, cal, date Working with Files: cat, more, less.
Linux+ Guide to Linux Certification, Third Edition
Λειτουργικά Συστήματα – Lab2 Γιάννης Πετράκης. Directory Navigation and Control  The Unix file system is set up like a tree branching out from the root.
Operating System Fundamentals 1. Components of an OS 2. Functions of an OS 3. Types of OS 4. Command-line tools.
File and Folder CLI Commands 12/24/ Agenda Overview of OS functions and the SHELL Internal v External Commands Command History Making & Modifying.
Basic DOS How to get some work done. It’s all a file Everything is a file: OS files, Application files, Data files and Game files Files have 8.3 names:
The Command Line Yep, you need to know this. The Basics Start with the Prompt, what the computer tells you when ready for a command You type a command.
XP New Perspectives on Microsoft Windows XP Tutorial 2 1 Microsoft Windows XP Working with Files Tutorial 2.
Guide to Parallel Operating Systems with Windows 7 and Linux Chapter 6 Directory Commands.
Guide to Parallel Operating Systems with Microsoft Windows XP and Linux Chapter 4 Directory Commands.
IST 222 Day 6. DOS Naming Conventions A filename contains up to 8 characters, a separating period, and a file extension of up to three characters This.
MS-DOS is an acronym for MicroSoft Disk Operating System It is a CUI based operating system. It provides user with a command prompt (generally called.
Introduction to Operating Systems IT190 Foundations in Information Technology.
Systems Administration (Windows) BIT3111 – Lecture 5 (Introduction to Windows OS)
INTERNAL COMMANDS CLS(Clear Screen):-
Chapter 6 Windows 9x/Me Commands and Startup Disk
Operating Systems and Using Linux
Operating System Fundamentals
Working with the Command- Line Interface
Chapter 6 Using DEL, REN, MOVE, and RD /S Ch 6.
OPERATING SYSTEM B-TECH III YEAR I SEM BRANCH :ECE
Lab 2: Terminal Basics.
1.3 Given a scenario, apply appropriate Microsoft command line tools
Command Prompt Using DEL, DELTREE, RENAME and MOVE
Presentation transcript:

1 DOS 2 Directory structure of disks Directory structure of disks Full Path or Full file specification Full Path or Full file specification Creating directories ( MD or MKDIR) Creating directories ( MD or MKDIR) Navigating a directory structure ( CD or CHDIR) Navigating a directory structure ( CD or CHDIR) Coping files to other directories ( COPY ) Coping files to other directories ( COPY ) Renaming files ( REN or RENAME ) Renaming files ( REN or RENAME ) Moving files to other directories ( MOVE ) Moving files to other directories ( MOVE ) Deleting files from directories ( DEL or ERASE ) Deleting files from directories ( DEL or ERASE ) Deleting directories ( RD or RMDIR ) Deleting directories ( RD or RMDIR ) Listing files in directories Listing files in directories View, print, and save a directory tree ( TREE ) View, print, and save a directory tree ( TREE )

2 Directory Also known as a folder. Also known as a folder. Acts as a container for files and other directories. Acts as a container for files and other directories. Is a special file type that contains information about the files and directories it tracks. Is a special file type that contains information about the files and directories it tracks. Directories provide a means of organizing the many files stored on a disk drive. Directories provide a means of organizing the many files stored on a disk drive.

3 Root Directory The ROOT directory is the first directory created. It is created AUTOMATICALLY when the disk is initialized or formatted. Formatting a disk is the ONLY way to create the ROOT directory. The ROOT directory is the first directory created. It is created AUTOMATICALLY when the disk is initialized or formatted. Formatting a disk is the ONLY way to create the ROOT directory. It is referred to with a backslash symbol \. It is referred to with a backslash symbol \. A:\>shows root directory of A drive A:\>shows root directory of A drive Note: The DOS prompt above typically shows you what drive and directory on that drive is the current default ( A:\> ).

4 Subdirectory A subdirectory is a directory contained within, or “below” another directory. A subdirectory is a directory contained within, or “below” another directory. This allows the creation of a hierarchy of directories on a disk drive. This allows the creation of a hierarchy of directories on a disk drive. It is subordinate to another directory or folder. It is subordinate to another directory or folder. EXAMPLE: EXAMPLE:A:\Programs\COBOL>_ COBOL is a subdirectory of Programs

5 DADBDCF1F2 Root DirectoryDDDEF3F4 DAF5F6F7 DDF20F21F22 DBF30F31 DC … F5 … F6 … F7F8F9F10 DE … F8 … F9 … F10 … F3 … F4 … F1 … F2 … F20 … F21 … F22 … F30 … F31

6 Parent Directory A directory containing, or “above”, another directory is reffered to as a parent directory. A directory containing, or “above”, another directory is reffered to as a parent directory. EXAMPLE: EXAMPLE:A:\Programs\COBOL>_ Programs is the parent directory of COBOL Programs is the parent directory of COBOL

7 FULL PATH A notation that identifies the exact location of a directory or file on disk. The full path includes the following for a directory or file on a disk: Drive Drive Sequence of directory name(s) separated by backslahes ‘\’. Sequence of directory name(s) separated by backslahes ‘\’. Name of the directory or file Name of the directory or file

8 FULL PATH EXAMPLES EXAMPLE: C:\programs\COBOL\Prog1.cob Drive Drive C: C: Sequence of directory name(s) (path) Sequence of directory name(s) (path) \programs\COBOL\ \programs\COBOL\ Name of the directory or file Name of the directory or file Prog1.cob Prog1.cob

9 MD - Make Directory The command to create or make a directory is the MD or MKDIR command The command to create or make a directory is the MD or MKDIR command The syntax is : The syntax is : MD [drive:][path]directory name MD [drive:][path]directory name

10 MD - Examples Create a directory at the root of A called Programs A:\>MD Programs Create a directory at the root of A called Programs A:\>MD Programs Create a directory at the root of C called Myfiles A:\>MD C:\Myfiles Create a directory at the root of C called Myfiles A:\>MD C:\Myfiles What will the following do? What will the following do? A:\ABC\XYZ>MD Myfiles A:\ABC\XYZ>MD Myfiles

11 MD - Subdirectories This creates a subdirectory called Memphis within another directory called CITIES A:\>MD CITIES\Memphis This creates a subdirectory called Memphis within another directory called CITIES A:\>MD CITIES\Memphis This creates a subdirectory called Nashville within the CITIES directory A:\>MD CITIES\Nashville This creates a subdirectory called Nashville within the CITIES directory A:\>MD CITIES\Nashville This creates a subdirectory called Knoxville within the CITIES directory (what’s different here?) A:\CITIES>MD Nashville This creates a subdirectory called Knoxville within the CITIES directory (what’s different here?) A:\CITIES>MD Nashville

12 CD - Change Directory The command to change the default directory to a different directory is the CD command. The command to change the default directory to a different directory is the CD command. The syntax is CD [drive:][path]directory name The syntax is CD [drive:][path]directory name

13 CD - Examples Change to a directory on the A drive called Programs Change to a directory on the A drive called Programs A:\>CD Programs Change to a subdirectory named Memphis that is under the directory Cities on the C drive Change to a subdirectory named Memphis that is under the directory Cities on the C drive C:\>CD Cities\Memphis A:\>CD C:\Cities\Memphis ??? Change to the root directory of the C drive Change to the root directory of the C drive C:\Cities\Nashville>CD \

14 MOVE Syntax: Syntax: MOVE [drive:][path]filespec destination MOVE [drive:][path]filespec destinationExamples: Move a file from one drive to another A:\>MOVE letter.doc C:\ A:\>MOVE \JKL\RST\letter.doc C:\ C:\>MOVE A:\JKL\RST\letter.doc ABC\DEF C:\>MOVE A:\JKL\RST\letter.doc D:\ABC\DEF

15 MOVE EXAMPLES Move a file named resume.doc into a directory called WORK Move a file named resume.doc into a directory called WORK A:\>MOVE resume.doc WORK Use a wildcard to move multiple files into a directory called DATES Use a wildcard to move multiple files into a directory called DATES A:\:>MOVE 2000*.* DATES

16 COPY file to another directory  Copy a file named resume.doc at the root of A into the directory DOCS on the C drive C:\>COPY A:\resume.doc C:\DOCS  Copy a file named expenses.txt from the COST directory into the PAYMENTS directory on the C drive A:\>COPY C:\COST\expenses.txt C:\PAYMENTS

17 COPY files within a directory If the new files are created in the same directory as the old files, the new files must have a different name If the new files are created in the same directory as the old files, the new files must have a different name Example: Example: A:\>COPY oldsales.* newsales.*

18 Copying a file Files can be copied Files can be copied Files can be copied from one disk to another Files can be copied from one disk to another Files can be copied from one directory to another Files can be copied from one directory to another When a file is copied, an additional file is created When a file is copied, an additional file is created The original file is left intact The original file is left intact Groups of files can be copied at once by using wildcards Groups of files can be copied at once by using wildcards

19 Syntax for COPY Syntax: COPY source [destination] Example: CA:\>COPY classfile.txt classtwo.txt

20 PRACTICE COPY Type the following: A:>DIR FILE*.* A:\>COPY classfile.txt file2.txt A:\>COPY file2.txt file3.txt A:\DIR FILE*.*

21 Renaming files The name of a file can be changed The name of a file can be changed When this is done, no additional file is created When this is done, no additional file is created The file itself is not moved The file itself is not moved

22 RENAMING SYNTAX Syntax: RENAME [drive:][PATH] filename1 filename2 OR REN [drive:][PATH] filename1 filename2 Examples: A:\>REN CLASSFILE.TXT NSTIFILE.TXT C:\ABC>REN A:\ABC\CLASS1.TXT CLASS2.TXT C:\ABC>REN A:\ABC\CLASS1.TXT CLASS2.TXT Notice there is no drive or path for filename2

23 PRACTICE RENAME Type in the following: A:\>DIR file*.* A:\>DIR file*.* A:\>RENAME file2.txt file4.txt A:\>RENAME file2.txt file4.txt A:\>DIR file*.* A:\>DIR file*.*

24 RENAMING FILES IN ANOTHER DIRECTORY OR DRIVE The name of a file can be changed in a directory that is different than the prompt (the default directory) Syntax: RENAME [drive:][PATH] filename1 filename2 RENAME [drive:][PATH] filename1 filename2 OR OR REN [drive:][PATH] filename1 filename2 REN [drive:][PATH] filename1 filename2Examples: C:\>REN A:\DEMO\CLASSFILE.TXT FILEA.TXT C:\>REN A:\DEMO\CLASSFILE.TXT FILEA.TXT C:\ABC>REN A:\DEMO\CLASS1.TXT FILE1.TXT C:\ABC>REN A:\DEMO\CLASS1.TXT FILE1.TXT

25 RENAME with WILDCARDS More than one file can be renamed by the use of wildcards. More than one file can be renamed by the use of wildcards. Examples: Examples: C:\>REN 2002*.DAT 2003*.DAT C:\>REN 2002*.DAT 2003*.DAT C:\ABC>REN A:\XYZ\2002*.DAT 2003*.DAT C:\ABC>REN A:\XYZ\2002*.DAT 2003*.DAT

26 PRACTICE REN /wildcards Type in the following: DIR 200* DIR 200* REN 2002* 2003* REN 2002* 2003* DIR 200* DIR 200*

27 Deleting files Files can be deleted from the command prompt Syntax: DEL filename Examples: A:\DEL NSTIFILE.TXT A:\ABC>DEL C:\XYZ\FILE.TXT A:\ABC>DEL C:\XYZ\FILE.TXT NOTE: Wildcards can be used to delete groups of files. The following is EXTREMELY dangerous The following is EXTREMELY dangerous A:\DEL *.* A:\DEL *.* A confirmation message will be displayed. A confirmation message will be displayed.

28 Prompt Switch and the DELETE command A prompt for verification switch (/P) can be used with the DELETE command A prompt for verification switch (/P) can be used with the DELETE command The names of the files to be deleted will be displayed and the user can verify whether to continue with the deleting The names of the files to be deleted will be displayed and the user can verify whether to continue with the deleting Example: A:\ABC>DEL NSTIFILE.TXT /P Example: A:\ABC>DEL NSTIFILE.TXT /P

29 PRACTICE DELETE Type in the following: COPY classfile.txt newfile1.txt COPY classfile.txt newfile1.txt COPY classfile.txt newfile2.txt COPY classfile.txt newfile2.txt DIR *file* DIR *file* DEL newfile1.txt DEL newfile1.txt DIR *file* DIR *file* DEL newfile2.txt /p DEL newfile2.txt /p DIR *file* DIR *file*

30 TREE The TREE command will display a directory tree The TREE command will display a directory tree A directory tree is a diagrammatic representation of the directory structure of a hard disk or diskette A directory tree is a diagrammatic representation of the directory structure of a hard disk or diskette

31 SYNTAX OF TREE Syntax: Syntax: TREE [drive:][path] Examples: Examples:A:\>TREE A:\>TREE CITIES A:\>TREE C:\ABC\PROGRAMS

32 Navigating a Directory Tree Change the directory AND drive in one command Change the directory AND drive in one command A:\>CD /d c:\doc*\letters The above command changes the prompt -drive from A to C -into the documents\letters directory

33.. DOT DOT Change to the parent directory of the current directory by typing in the following: Change to the parent directory of the current directory by typing in the following: A:\ABC\JKL>CD.. Directory A:\ABC is now current A:\ABC\JKL>CD.. Directory A:\ABC is now current Type in: A:\Labs\Lab01>CD.. Type in: A:\Labs\Lab01>CD.. And the prompt changes to: A:\Labs> And the prompt changes to: A:\Labs>

34 TREE-switches The TREE command has two switches that can be used in display and print The TREE command has two switches that can be used in display and print /Fadds filenames to the directory list /Fadds filenames to the directory list /Adisplays an alternate format /Adisplays an alternate format Example: A:\>TREE /F /A

35 Save TREE to a File To save the listing of TREE, use the redirection operator (>) To save the listing of TREE, use the redirection operator (>) Examples: Examples: A:\>TREE > filelist.txt A:\>TREE /F > filelist.txt A:\>TREE /A > filelist.txt A:\>TREE /F /A > filelist.txt

36 Print TREE To print the listing of TREE, use the redirection operator (>) To print the listing of TREE, use the redirection operator (>) Examples: Examples: A:\>TREE > LPT1 A:\>TREE > LPT1 A:\>TREE /F > PRN A:\>TREE /F > PRN A:\>TREE /A > PRN A:\>TREE /A > PRN A:\>TREE /F /A > LPT2 A:\>TREE /F /A > LPT2

37 XCOPY You can use the XCOPY command to copy all the files in the specified directory and (optionally) all its subdirectories to another drive and/or directory. XCOPY source [destination] [/S] [/M] [/A] XCOPY source [destination] [/S] [/M] [/A]Example: A:\ABC A:\ABC This copies the contents of the current directory to the root of A:.

38 XCOPY /S The /S switch enables XCOPY to also copy any directories and files beneath the current directory, but it will NOT include empty directories. Example: A:\ABC /S A:\ABC /S This copies the contents of the current directory and ALL its subdirectories (if not empty) to the root of A:.

39 XCOPY /M The /M switch copies files with the archive attribute on and then turns it off.

40 XCOPY/A The /A switch copies files with the archive attribute on but does NOT turn it off.