IOS 110 File and Folder CLI Commands 9102020

  • Slides: 25
Download presentation
IOS 110 File and Folder CLI Commands 9/10/2020 1

IOS 110 File and Folder CLI Commands 9/10/2020 1

Agenda Overview of OS functions and the SHELL Internal v External Commands Command History

Agenda Overview of OS functions and the SHELL Internal v External Commands Command History Making & Modifying Directories Making & Modifying Files

Overview of OS Functions Application Program Layer File Management User Interface (shell) Operating System

Overview of OS Functions Application Program Layer File Management User Interface (shell) Operating System Layer Device Management Hardware Layer Task Management

SHELL OPEN FILE Application Program Layer User Interface (shell) cmd. exe File Management Operating

SHELL OPEN FILE Application Program Layer User Interface (shell) cmd. exe File Management Operating System Layer Device Management Hardware Layer Task Management

CLI Syntax Command tells CLI “what” user wants to do Parameter tells CLI “where”

CLI Syntax Command tells CLI “what” user wants to do Parameter tells CLI “where” user wants the command to happen. (A: ) Switch (or Option) tells CLI “how” the user wants the command to be executed C: > COPY /A /V myfile. txt e: backup Prompt Drive and path Command Switch /A ASCII file /V Verify after copying Parameter 1 Source Parameter 2 Target

Internal Commands Internal commands are built into the command interpreter cmd. exe Installed with

Internal Commands Internal commands are built into the command interpreter cmd. exe Installed with OS No disk access Faster performance Examples: CD, CHDIR COPY DEL DIR ECHO GOTO REN, RENAME RD, RMDIR SET START TITLE PAUSE

External Commands external commands that are not built into the command interpreter cmd. exe

External Commands external commands that are not built into the command interpreter cmd. exe Installed in separate folder Disk Access required Slower performance Examples: TREE MORE HELP IPCONFIG PING ATTRIB XCOPY SORT NET

Command History DOSKEY F 7 – to list commands to date F 9 –

Command History DOSKEY F 7 – to list commands to date F 9 – to select command number and place on the command line F 3 – to repeat previous command UP Arrow – to scroll previous command F 2 – edits previous command line up to the identified character

Directories and File-- CLI

Directories and File-- CLI

Directories and Files - GUI n Same Explorer information, but different views

Directories and Files - GUI n Same Explorer information, but different views

Directories and Files Root C:  ChildParent IOS 110 Lectures Lecture 1. txt Lecture

Directories and Files Root C: ChildParent IOS 110 Lectures Lecture 1. txt Lecture 1. pps Lab 1. htm Lab 2. draft. htm Child

File Names You can use most characters in a file name although there are

File Names You can use most characters in a file name although there are some illegal ones: /: *? "<>| File names can be up to 255 characters and can use upper and lower case, spaces and multiple extensions Win 16 programs must use 8. 3 rule XP automatically creates a “short file name” or “alias” Long file name (LFN) e. g. The little brown foxx. jan. doc Alias Thelit~1. doc 9/10/2020 12

Absolute and Relative Paths C:  Absolute path defines a file or directory from

Absolute and Relative Paths C: Absolute path defines a file or directory from the root IOS 110lab 1. htm IOS 110 Lectures Lecture 1. txt Lecture 1. pps Lab 1. htm Lab 2. draft. htm . . lab 1. htm Relative path defines a file or directory from the working directory (its position in the directory tree)

Make a directory (MD, MKDIR) To create or make a directory type md or

Make a directory (MD, MKDIR) To create or make a directory type md or mkir at the prompt, with the name of the directory For example, to create a file called data, use the command: MD data 9/10/2020 14

Change Directory (CD, CHDIR) To switch between directories, we use the CD command (chdir

Change Directory (CD, CHDIR) To switch between directories, we use the CD command (chdir will also work). Note: if you use the CD command misspell the directory or enter a directory that does not exist, you will receive an error message. ”the system cannot find the path specified” To go to the root from anywhere type cd To go up one directory (parent) type cd. . To go up 2 levels type cd. . . . 9/10/2020 15

Remove Directory (RD) To remove an empty directory, the RD command works well. If

Remove Directory (RD) To remove an empty directory, the RD command works well. If your directory is not empty though, you need to add the /s switch to delete a “directory tree” 9/10/2020 16

Practice Create two directories January and February under the root of C: . Create

Practice Create two directories January and February under the root of C: . Create three directories under January: tests, quizzes and labs Create the same three directories under February. Navigate to the c: Februaryquizzes directory. How would you get from this directory to the Januarytests directory? 9/10/2020 17

Absolute Pathnames Exercise Create a directory called week 2 under the root of C:

Absolute Pathnames Exercise Create a directory called week 2 under the root of C: you would type: C: > MD c: week 2 or C: > MD week 2 (TRY IT) Once that directory has been created, let’s say you want to create a subdirectory called prac 2 in week 2. Using absolute pathnames you would type C: > MD week 2prac 2 (TRY IT) 9/10/2020 18

Absolute Pathnames Practice Create a directory called cars under the root of C:

Absolute Pathnames Practice Create a directory called cars under the root of C: Create the following directories using absolute paths only C: carsSUVs C: carscompact C: carssports C: carsSUVsescape C: carsSUVstribute When you are done, run the command TREE cars For more absolute path information click here 9/10/2020 19

Relative Pathnames Instead of working from the root, we work from our current or

Relative Pathnames Instead of working from the root, we work from our current or working directory. For example, if you were in the c: apps directory and wanted to create a directory called word within the apps directory, you would simple type: MD word 9/10/2020 20

Relative Pathnames Exercises We have the following directory structure: C: Appsword C: AppsGhost Assuming

Relative Pathnames Exercises We have the following directory structure: C: Appsword C: AppsGhost Assuming you were in the AppsGhost directory and you wanted to create a directory in the root of C: called Games. You could type MD. . games The. . brings you up two levels back to the root. 9/10/2020 21

DIR command If you want to see a listing of all of the files

DIR command If you want to see a listing of all of the files and folders in a given directory or even your entire system, then this is the command to use. DIR always lists the contents of your working directory unless you specify a directory such as: DIR c: 2005January This command will list the contents of the January directory. If you were in the January directory then simply typing the command DIR would also display the contents of the January directory. 9/10/2020 22

Viewing Text Files If all you want to do is view the contents of

Viewing Text Files If all you want to do is view the contents of a file, then use the TYPE command. TYPE [path to file] will display the contents of the file to the screen However, if file is large it will scroll past very fast. For large files use Type file 1. txt | more The “|” pipe symbol is used to filter the output one page at a time More file 1. txt file 2. txt file 3. txt More is a better command but is “external”. It automatically filters input and provides a “submenu” for greater control 9/10/2020 23

Create a Text File Notepad Edit Copy con Note: remember the path where you

Create a Text File Notepad Edit Copy con Note: remember the path where you saved them!! To help you remember display the full path to the file in the title bar In an Explorer window go to ToolsFolder OptionsView and click “Display Full Path in Title Bar”

DEL (Delete) command To delete a file, use the DEL command. You can delete

DEL (Delete) command To delete a file, use the DEL command. You can delete multiple files at once by using wildcards. Remember, use the RD command to remove empty directories 9/10/2020 25