11.4.2.7 Lab – File System Commands Answers

Last Updated on February 8, 2021 by Admin

11.4.2.7 Lab – File System Commands Answers

   IT Essentials v7.0 & 7.02   
Final Exam Answers Ch 1 - 9
Final Exam Answers Ch 10 - 14
Final Exam Composite Answers Ch 1 - 14
IT Essentials 7.02 - Chapter 11
Chapter 11 Exam Answers Online Test
Chapter 11 Quiz Answers Online Test
IT Essentials 7.02 - Chapter 12
Chapter 12 Exam Answers Online Test
Chapter 12 Quiz Answers Online Test
Checkpoint Exam #4 (Chapters 10 – 11) Answers Online Test
IT Essentials 7.02 - Lab Answers
11.1.2.10 Lab – Explore the Windows Desktop Answers
11.1.3.4 Lab – Work with Task Manager Answers
11.1.4.11 Lab – Working with File Explorer Answers
11.2.1.5 Lab – Explore Control Panel Categories Answers
11.2.2.3 Lab – User Accounts Answers
11.2.3.5 Lab – Configure Browser Settings Answers
11.2.5.8 Lab – Manage Virtual Memory Answers
11.2.6.2 Lab – Use Device Manager Answers
11.2.7.4 Lab – Region and Language Options Answers
11.3.1.11 Lab – Monitor and Manage System Resources Answers
11.3.2.7 Lab – System Utilities Answers
11.3.2.8 Lab – Manage System Files Answers
11.3.3.8 Lab – Hard Drive Maintenance Answers
11.3.4.6 Lab – Install Third-Party Software Answers
11.4.1.5 Lab – Work in the Windows Command Shell Answers
11.4.2.7 Lab – File System Commands Answers
11.4.3.2 Lab – Disk CLI Commands Answers
11.4.4.2 Lab – Task and System CLI Commands Answers
11.4.5.3 Lab – Other Useful Commands Answers
11.5.2.4 Lab – Share Resources Answers
11.5.4.2 Lab – Connect and Test the Wireless Connection Answers
11.5.6.2 Lab – Windows Remote Desktop and Assistance Answers
11.6.1.2 Lab – Manage the Startup Folder Answers
11.6.1.5 Lab – Schedule a Task Using the GUI and the Command Line Answers
11.6.2.4 Lab – System Restore and Hard Drive Backup Answers
11.7.3.2 Lab – Troubleshoot Operating System Problems Answers
IT Essentials 7.02 - Packet Tracer Answers & Solution
11.5.5.3 Packet Tracer – Use Telnet and SSH Answers

Lab – File System Commands (Answers Version)

Answers Note: Red font color or gray highlights indicate text that appears in the Answers copy only.

Introduction

In this lab, you will use CLI commands to manage files and folders in Windows.

Recommended Equipment

  • A computer running Windows

Answers Note: The students can complete this lab from any of the four Windows operating systems. Students may need to change the example directory letter C if a different letter is used on the lab computers.

Instructions

Step 1:Access the Windows command prompt.

  1. Log on to a Windows computer. The account ITEUser is used as the example user account throughout this lab.
  2. To access the Windows command prompt, click Start and enter cmd. Select Command Prompt or cmd.exe to continue.

Step 2:Create and change directories.

In this step, you will use the change directory (cd), make directory (md), and directory (dir) commands.

Note: A directory is another word for folder. Directory and folder are used interchangeably throughout this lab.

  1. Type cd at the command prompt.

Question:

What is the current directory?

Answers may vary. The directory C:\Users\ITEUser is used as an example for this lab.

  1. Type dir at the command prompt to list the files and folders that are in the current folder.

C:\Users\ITEUser> dir

Volume in drive C has no label.

Volume Serial Number is 9055-35E9

Directory of C:\Users\ITEUser

04/27/201909:21 AM<DIR>.

04/27/201909:21 AM<DIR>..

04/25/201911:39 AM<DIR>3D Objects

04/25/201911:39 AM<DIR>Contacts

04/26/201910:29 AM<DIR>Desktop

04/25/201911:39 AM<DIR>Documents

04/25/201911:39 AM<DIR>Downloads

<some output omitted>

0 File(s)0 bytes

15 Dir(s)32,671,969,280 bytes free

  1. In the current directory, use the md command to create three new folders: ITEfolder1, ITEfolder2, and ITEfolder3. Type md ITEfolder1 and press Enter. Create ITEfolder2 and ITEfolder3. (Note: The command mkdir performs the same function as the command md.)

C:\Users\ITEUser> md ITEfolder1

C:\Users\ITEUser> md ITEfolder2 ITEfolder3

  1. Type dir to verify that the folders have been created.
  2. Type cd ITEfolder3 at the command prompt and press Enter.

Question:

Which folder are you in now?

Answers may vary. The current directory is C:\Users\ITEUser\ITEfolder3 in this example.

  1. Create ITEfolder4 in the current directory. Within the ITEfolder4 folder, create a folder named ITEfolder5. Use the dir command to verify the folder creation.

Question:

What command or commands did you use to create the nested folders?

This can be accomplished in 1 or 2 commands to create the folders:

C:\Users\ITEUser\ITEfolder3> md ITEfolder4\ITEfolder5

Or

C:\Users\ITEUser\ITEfolder3> md ITEfolder4

C:\Users\ITEUser\ITEfolder3> cd ITEfolder4

C:\Users\ITEUser\\ITEfolder3\ITEfolder4> md ITEfolder5

  1. Change directory as necessary until you are in ITEfolder5.
  2. Type cd .. to change the current directory. Each .. is a shortcut to move up one level in the directory tree.

Question:

After issuing the cd .. command, what is your directory now?

C:\Users\ITEUser\ITEfolder3\ITEFolder4

What would be the current directory if you issue this command at C:\Users\ITEfolder4?

C:\Users\ITEUser\ITEFolder3

Step 3:Create text files.

  1. Navigate to the C:\Users\ITEUser\ITEfolder1 directory. Type cd ..\ITEfolder1 at the prompt.
  2. Type echo This is doc1.txt > doc1.txt at the command prompt. The echo command is used to display a message at the command prompt. The > is used to redirect the message from the screen to a file. For example, in the first line, the message This is doc1.txt is redirected into a new file named doc1.txt. Use the echo command and > redirect to create these files: doc2.txt, file1.txt, and file2.txt.

C:\Users\ITEUser\ITEfolder1> echo This is doc1.txt > doc1.txt

C:\Users\ITEUser\ITEfolder1> echo This is doc2.txt > doc2.txt

C:\Users\ITEUser\ITEfolder1> echo This is file1.txt > file1.txt

C:\Users\ITEUser\ITEfolder1> echo This is file2.txt > file2.txt

  1. Use the dir command to verify the files are in the ITEfolder1 folder.

C:\Users\ITEUser\ITEFolder1> dir

<some output omitted>

04/29/201908:05 AM19 doc1.txt

04/29/201908:06 AM19 doc2.txt

04/29/201908:08 AM20 file1.txt

04/29/201908:08 AM20 file2.txt

4 File(s)78 bytes

2 Dir(s)32,625,397,760 bytes free

  1. Use the more or type command to view the content of the newly created text files.

C:\Users\ITEUser\ITEfolder1> more doc1.txt

This is doc1.txt

C:\Users\ITEUser\ITEfolder1> type doc2.txt

This is doc2.txt

Step 4:Copy, delete, and move files.

  1. At the command prompt, type move doc2.txt C:\Users\ITEUser\ITEfolder2 to move the file doc2.txt to the C:\Users\ITEUser\ITEfolder2 directory.

C:\Users\ITEUser\ITEfolder1> move doc2.txt C:\Users\ITEUser\ITEfolder2

1 file(s) moved.

  1. Type dir at the prompt to verify that doc2.txt is no longer in the current directory.
  2. Navigate to C:\Users\ITEUser\ITEfolder2 to change the directory to ITEfolder2. Type dir at the prompt to verify doc2.txt has been moved.
  3. Type copy doc2.txt doc2_copy.txt to create a copy of doc2.txt. Type dir at the prompt to verify a copy of the file has been created.

C:\Users\ITEUser\ITEfolder2> dir

<some output omitted>

Directory of C:\Users\ITEUser\ITEfolder2

04/30/201909:07 AM19 doc2.txt

04/30/201909:07 AM19 doc2_copy.txt

2 File(s)38 bytes

2 Dir(s)31,753,068,544 bytes free

  1. Use the move command to move doc2_copy.txt to ITEfolder1. Type move doc2_copy.txt ..\ITEfolder1.

C:\Users\ITEUser\ITEfolder2> move doc2_copy.txt ..\ITEfolder1

1 file(s) moved.

  1. A copy of the file doc2.txt can be created in a new location using the copy command. At the prompt, enter the copy doc2.txt ..\ITEfolder1\doc2_new.txt.

C:\Users\ITEUser\ITEfolder2> copy doc2.txt ..\ITEfolder1\doc2_new.txt

1 file(s) copied.

  1. The file doc2.txt can also be moved to a new location with a new filename using the move command. Type move doc2.txt ..\ITEfolder1\doc2_new.txt at the prompt.

C:\Users\ITEUser\ITEfolder2> move doc2.txt ..\ITEfolder1\doc2_move.txt

1 file(s) moved.

  1. Type dir ..\ITEfolder1 to view the content in ITEfolder1 without leaving the current directory.

C:\Users\ITEUser\ITEfolder2> dir ..\ITEfolder1

<some output omitted>

Directory of C:\Users\ITEUser\ITEfolder1

04/29/201912:08 PM<DIR>.

04/29/201912:08 PM<DIR>..

04/29/201908:05 AM19 doc1.txt

04/29/201908:06 AM19 doc2_copy.txt

04/29/201908:06 AM19 doc2_move.txt

04/29/201908:06 AM19 doc2_new.txt

04/29/201908:08 AM20 file1.txt

04/29/201908:08 AM20 file2.txt

6 File(s)116 bytes

2 Dir(s)31,467,700,224 bytes free

  1. Change the current directory to ITEfolder1. Type cd ..\ITEfolder1 at the prompt.
  2. Move file1.txt and file2.txt into ITEfolder3. To move all the files that contain the word file into ITEfolder3 with one command, use a wildcard (*) character to represent one or more characters. Type move file* ..\ITEfolder3.

C:\Users\ITEUser\ITEfolder1> move file* ..\ITEfolder3

C:\Users\ITEUser\ITEfolder1\file1.txt

C:\Users\ITEUser\ITEfolder1\file2.txt

2 file(s) moved.

  1. To view the content of the file doc2_new.txt, use the type or more command at the prompt.

C:\Users\ITEUser\ITEfolder1> type doc2_new.txt

This is doc2.txt

  1. Use the ren command to rename doc2_new.txt to doc3.txt. Use the dir command to display the content in the directory.

c:\Users\ITEUser\ITEfolder1> ren doc2_new.txt file.log

  1. Use the type or more command to view the content of the newly rename file file.log.

C:\Users\ITEUser\ITEfolder1> more file.log

This is doc2.txt

  1. To delete a file or multiple files, use the del command with the file names at the prompt.

Question:

What single command would you use to delete all the files with doc2 in the filename? Use the command to remove the files with doc2 in the filename.

Answer may vary. C:\Users\ITEUser\ITEfolder1> del doc2*

What command would you use to delete all the files in the directory? Use the command to remove the files.

Answer may vary. C:\Users\ITEUser\ITEfolder1> del *.*

Step 5:Use the xcopy and robocopy commands.

In this step, the xcopy and robocopy commands are used to copy the content in a directory.

  1. View the content of ITEfolder3.

C:\Users\ITEUser\ITEfolder1> dir ..\ITEfolder3

<some output omitted>

Directory of c:\Users\ITEUser\ITEfolder3

04/29/201903:11 PM<DIR>.

04/29/201903:11 PM<DIR>..

04/29/201903:05 PM20 file1.txt

04/29/201903:05 PM20 file2.txt

04/29/201903:01 PM<DIR>ITEfolder4

2 File(s)40 bytes

3 Dir(s)31,492,157,440 bytes free

  1. Type xcopy ..\ITEfolder3 . at the prompt to copy the content of ITEfolder3 to ITEfolder1. Note the . at the end of the command. It is a shortcut for the current directory.

C:\Users\ITEUser\ITEfolder1> xcopy ..\ITEfolder3 .

..\ITEfolder3\file1.txt

..\ITEfolder3\file2.txt

2 File(s) copied

  1. At the prompt, type dir to display the content of ITEfolder1. Only the files in the ITEfolder3 were copied into ITEfolder1. The directory ITEfolder4 was not copied into ITEfolder3.

C:\Users\ITEUser\ITEfolder1> dir

<some output omitted>

Directory of C:\Users\ITEUser\ITEfolder1

04/29/201903:16 PM<DIR>.

04/29/201903:16 PM<DIR>..

04/29/201903:05 PM20 file1.txt

04/29/201903:05 PM20 file2.txt

2 File(s)40 bytes

2 Dir(s)31,491,321,856 bytes free

  1. Use help xcopy or xcopy /? to determine which switch would allow the xcopy command to copy all the files and directories.

Question:

What option allows you to copy all the files and directories, including the empty directories?

The option is /E.

  1. Because ITEfolder4 is a subfolder and ITEfolder5 is both a subfolder and an empty folder, /E is needed to copy all the contents of ITEfolder3 and the empty subfolder.

Type xcopy /E ..\ITEfolder3 . at the prompt to copy the files. When prompted, type a to allow overwriting the existing files.

c:\Users\ITEUser\ITEfolder1> xcopy /E ..\ITEfolder3

Overwrite C:\Users\ITEUser\ITEfolder1\file1.txt (Yes/No/All)? a

..\ITEfolder3\file1.txt

..\ITEfolder3\file2.txt

2 File(s) copied

  1. Verify that the ITEfolder4 and ITEfolder5 were also copied in ITEfolder1.

c:\Users\ITEUser\ITEfolder1> dir

<some output omitted>

Directory of c:\Users\ITEUser\ITEfolder1

04/29/201904:41 PM<DIR>.

04/29/201904:41 PM<DIR>..

04/29/201903:05 PM20 file1.txt

04/29/201903:05 PM20 file2.txt

04/29/201904:41 PM<DIR>ITEfolder4

2 File(s)40 bytes

3 Dir(s)31,493,193,728 bytes free

c:\Users\ITEUser\ITEfolder1> dir ITEfolder4

<some output omitted>

Directory of c:\Users\ITEUser\ITEfolder1\ITEfolder4

04/29/201904:41 PM<DIR>.

04/29/201904:41 PM<DIR>..

04/29/201903:00 PM<DIR>ITEfolder5

0 File(s)0 bytes

3 Dir(s)31,493,193,728 bytes free

  1. The robocopy command can also be used to copy the content of a directory to a new destination. The robocopy command has more capabilities than the built-in Windows copy and xcopy command, such as resume copying after a network interruption, skip files that appear to be identical to the files in the destination folders, and mirror a directory by keeping the destination directory in sync with the source directory.

Copy the ITEfolder4 content to ITEUser folder using the robocopy command.

C:\Users\ITEUser\ITEfolder1> robocopy /E C:\Users\ITEUser\ITEfolder3\ITEfolder4\ C:\Users\ITEUser

Note the information provided by the command during the copying process.

  1. Navigate to C:\Users\ITEUser to verify that the folder ITEfolder5 is copied.

Step 6:Delete directories.

In this step, you will delete an empty and a non-empty directory using the rd command.

  1. Use the rd ITEfolder2 to delete the empty directory and verify that the directory was deleted.

C:\Users\ITEUser> rd ITEfolder2

  1. Navigate to the C:\Users\ITEUser\ITEfolder3 directory.
  2. Use the rd ITEfolder1 to delete the directory. Verify the directory removal using the dir command.

Were you able to delete the directory? Explain.

You were not able to delete the directory because it was not empty.

  1. Use rd /? command to determine the switch that allows the deletion of a non-empty directory.

c:\Users\ITEUser\ITEfolder3> rd /S ITEfolder1

ITEfolder4, Are you sure (Y/N)? y

  1. Use the appropriate commands to delete all the text files and folders that you have created in this lab. Type exit to close the command prompt window.

Reflection Question

What are the advantages of using CLI vs. GUI?

Answers may vary. For example, the commands in the CLI in Windows have not changed in the different Windows versions. The GUI interfaces in different Windows versions have changed dramatically.

   IT Essentials v7.0 & 7.02   
Final Exam Answers Ch 1 - 9
Final Exam Answers Ch 10 - 14
Final Exam Composite Answers Ch 1 - 14
IT Essentials 7.02 - Chapter 11
Chapter 11 Exam Answers Online Test
Chapter 11 Quiz Answers Online Test
IT Essentials 7.02 - Chapter 12
Chapter 12 Exam Answers Online Test
Chapter 12 Quiz Answers Online Test
Checkpoint Exam #4 (Chapters 10 – 11) Answers Online Test
IT Essentials 7.02 - Lab Answers
11.1.2.10 Lab – Explore the Windows Desktop Answers
11.1.3.4 Lab – Work with Task Manager Answers
11.1.4.11 Lab – Working with File Explorer Answers
11.2.1.5 Lab – Explore Control Panel Categories Answers
11.2.2.3 Lab – User Accounts Answers
11.2.3.5 Lab – Configure Browser Settings Answers
11.2.5.8 Lab – Manage Virtual Memory Answers
11.2.6.2 Lab – Use Device Manager Answers
11.2.7.4 Lab – Region and Language Options Answers
11.3.1.11 Lab – Monitor and Manage System Resources Answers
11.3.2.7 Lab – System Utilities Answers
11.3.2.8 Lab – Manage System Files Answers
11.3.3.8 Lab – Hard Drive Maintenance Answers
11.3.4.6 Lab – Install Third-Party Software Answers
11.4.1.5 Lab – Work in the Windows Command Shell Answers
11.4.2.7 Lab – File System Commands Answers
11.4.3.2 Lab – Disk CLI Commands Answers
11.4.4.2 Lab – Task and System CLI Commands Answers
11.4.5.3 Lab – Other Useful Commands Answers
11.5.2.4 Lab – Share Resources Answers
11.5.4.2 Lab – Connect and Test the Wireless Connection Answers
11.5.6.2 Lab – Windows Remote Desktop and Assistance Answers
11.6.1.2 Lab – Manage the Startup Folder Answers
11.6.1.5 Lab – Schedule a Task Using the GUI and the Command Line Answers
11.6.2.4 Lab – System Restore and Hard Drive Backup Answers
11.7.3.2 Lab – Troubleshoot Operating System Problems Answers
IT Essentials 7.02 - Packet Tracer Answers & Solution
11.5.5.3 Packet Tracer – Use Telnet and SSH Answers

End of Document

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments