Download presentation
Presentation is loading. Please wait.
Published byAmice Holland Modified over 8 years ago
1
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Survey of Operating Systems, 4/e Chapter The Command-Line Interface 9
2
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. “ ” The Windows Command Prompt tool, and many of its commands, might seem boring or even relatively useless at first glance, but as anyone who has ever used the Command Prompt very often can tell you there’s much to love! Tim Fisher In an article at about.com titled 21 Command Prompt Tricks and Hacks
3
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Learning OutcomesLearning Outcomes Open the Windows 7 or Windows 8 Command Prompt in the context of a Standard user or Administrator. Use various techniques to use commands at the Windows Command Prompt. Enter CLI commands at OS X’s Terminal window.
4
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Introduction to the Windows Command Prompt LO 9.1LO 9.1
5
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. The Windows Command Prompt is Not MS-DOSThe Windows Command Prompt is Not MS-DOS MS-DOS was a small OS It had no security features It had a simple CLI and no native GUI The MS-DOS command interpreter was command.com The Command Prompt command interpreter is cmd.exe Command Prompt is subject to Windows security
6
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. The Windows Command Prompt is Not Windows PowerShellThe Windows Command Prompt is Not Windows PowerShell PowerShell is a CLI scripting environment for advanced users PowerShell accepts some Command Prompt commands PowerShell works with three other types of commands Windows Command Prompt only accepts text as input PowerShell accepts text as well as software objects as input
7
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Opening Windows 7 Command Prompts Open the Standard-User Command Prompt from the Accessories folder on the Windows 7 Start Menu
8
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Opening Windows 7 Command Prompts The Windows 7 Command Prompt for the Standard-User context
9
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Opening Windows 7 Command Prompts Open an Administrator Command Prompt in Windows 7 From the Accessories menu right-click on Command Prompt and select Run as administrator
10
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Opening Windows 7 Command Prompts The Windows 7 Administrator Command Prompt
11
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Opening Windows 7 Command Prompts The Windows 7 Safe Mode Command Prompt
12
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Opening Windows 7 Command Prompts Open the System Recovery Command Prompt Boot from the Windows 7 disc and select Repair your computer to access Recovery Options
13
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Opening Windows 7 Command Prompts From the System Recovery Options menu select Command Prompt
14
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Windows 8 Command Prompts Select Command Prompt from the Power User menu
15
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Windows 8 Command Prompts Windows 8 Standard-User Command Prompt
16
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Windows 8 Command Prompts Windows 8 Administrator Command Prompt
17
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Windows 8 Command Prompts Windows 8 Recovery Command Prompt
18
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Success at the Windows Command Prompt LO 9.2LO 9.2
19
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. How does the Command Prompt use letter case?How does the Command Prompt use letter case? Windows is case-aware, but not case-sensitive It will preserve letter case for file and folder names It does not require case to match when referencing files Commands are interpreted by letter, not case To Windows (and the Command Prompt) dir is the same as DIR
20
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. How does the Command Prompt interpret a command?How does the Command Prompt interpret a command? Command Prompt receives command Locates the command’s program code Loads the program code into memory Passes options from the command line to the program Command Prompt parses the command and options Spaces separate parameters Command Prompt issues error messages
21
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. The Command Prompt issues error messages when commands are entered incorrectly How does the Command Prompt interpret a command?How does the Command Prompt interpret a command?
22
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. How is a program found and loaded?How is a program found and loaded? Command interpreter locates command’s program code It first checks if the program is an internal command Internal commands are stored in the operating system code If no match, it searches the current directory Then searches paths described in the registry See the search paths used by Windows using the path command
23
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Use the path command to see the Windows search paths How is a program found and loaded?How is a program found and loaded?
24
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Type help and press E NTER Several pages scroll off the screen Using the Help Command with RedirectionUsing the Help Command with Redirection
25
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Repeat the help command and pipe it to more: help | more Press S PACEBAR to scroll one window at a time or press E NTER to display one line at a time Using the Help Command with RedirectionUsing the Help Command with Redirection
26
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Repeat the help command and redirect its output to a file: help > help.txt Open the file in Notepad: notepad help.txt Using the Help Command with RedirectionUsing the Help Command with Redirection
27
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. To find the syntax for the xcopy command enter this: xcopy /? What is the Correct Syntax?What is the Correct Syntax?
28
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. To find the syntax for the robocopy command enter this: robocopy /? What is the Correct Syntax?What is the Correct Syntax?
29
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Batch Files at the Command PromptBatch Files at the Command Prompt A text file that contains commands Batch files automate tasks Windows batch files should use the cmd extension The bat extension is for MS-DOS and very old versions of Windows Both types will run in the Command Prompt
30
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Working with Files and DirectoriesWorking with Files and Directories File and Directory Basics Do not use reserved characters in a directory or file name Do not use names reserved by Windows in directory or file names Use meaningful names Do not delete existing file name extensions when renaming Use wildcards at the Command Prompt
31
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Working with Files and DirectoriesWorking with Files and Directories Understand File Attributes Read-only Archive System Hidden Volume Label Directory
32
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. The attrib command shows the attributes for files in the Documents directory. File AttributesFile Attributes
33
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Managing Files and Directories The dir command shows a listing of files and directories in the user’s home directory
34
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Managing Files and Directories Copy all text files from the home directory to the Documents directory: copy *.txt documents
35
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Managing Files and Directories Move down one level down into the Documents directory: cd documents
36
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Managing Files and Directories Check that the files were copied: dir
37
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Managing Files and Directories Create a directory in the Documents directory: md manuals
38
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Managing Files and Directories Create a directory while copying the contents of the of the manuals directory into mybackup: xcopy manuals mybackup
39
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Managing Files and Directories Use robocopy to copy the mybackup directory into a directory named newbackup: robocopy mybackup newbackup
40
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Managing Files and Directories See what was copied into newbackup: dir newbackup
41
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Working with Files and DirectoriesWorking with Files and Directories Robust copying with robocopy Sophisticated CLI file/directory copy command Provides a detailed report of the results Indicate source and destination: drive:\path or \\servername\share\path It copies all files within a source No file names in source of destination File names can be used elsewhere on the robocopy command line File names must be after the source and destination and before options unless part of an option
42
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Using Terminal in OS X LO 9.3LO 9.3
43
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. IntroductionIntroduction Terminal window is OS X CLI OS X security applies to Terminal Terminal shares features with other CLIs Internal and external commands Uses command-line delimiters and options BASH command interpreter Search paths Supports batch files Many commands identical to Linux Terminal is case-sensitive and case-aware
44
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Launch TerminalLaunch Terminal Applications | Utilities | Terminal
45
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Launch TerminalLaunch Terminal Add Terminal to the Dock
46
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. The Terminal Window The Terminal window (on right) with two tabs Shell menu open on left
47
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Shell Commands in Terminal Press T AB key twice Press Y to continue
48
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Shell Commands in Terminal A listing of the user’s home directory (at top) in Terminal A Finder window (bottom) open to the same directory
49
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Using the Man Command Display the manpage for the ls command: man ls
50
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Using the Man Command List both hidden and nonhidden files and directories: ls -a
51
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Using the Man Command List both hidden and nonhidden files and directories and identify directories with a forward slash (/): ls -aF
52
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Using the Man Command Change to the parent directory: cd.. Change to the Home directory: cd ~ Change to the Documents directory: cd Documents
53
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Command CompletionCommand Completion Use the Tab key to trigger command completion
54
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner. This document may not be copied, scanned, duplicated, forwarded, distributed, or posted on a website, in whole or part. Creating and Navigating DirectoriesCreating and Navigating Directories
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.