WINDOWS COMMAND PROMPT

LESSON – CREATING AND DELETING FILES & FOLDERS

 

separator-blank.png

 

INDIVIDUAL WORK

 

QUESTION 0 – SETUP

 

From the previous lesson, you should already have a folder called cmdWork. 

 

From this lesson’s group work, you should already have a folder inside cmdWork called Lesson2Work.

 

QUESTION 1 – REDIRECTING INTO FILES

 

Go inside the Hockey directory.  There you will find several text files each containing a quote.

 

You need to copy the quote of each text file into the file named quotes.txt.  Make sure you copy the content based on the alphabetical order of the file names.  So, the quote in a.txt should be first.  Then the one from b.txt.  And so on…  Each quote should be on their own line.

 

To do this, use the type command and the >> symbols. 

 

Remember that the up arrow will also be useful to recall the previously used command (that you can alter).

In all.txt, what sentence is created by the first letter of each line?  Place your answer in a file named answer.txt that should be created inside the directory Hockey.

 

 

QUESTION 2 – CREATING DIRECTORIES

a)    Go inside the Me directory in the Lesson2Work directory.

b)    Create a directory named I.

 

c)     Go inside I.

 

d)    Create two directories.  One named am and the other named aint.

 

e)    Go inside the am directory.

 

f)      Create at least three directories.  The name of each directory should be a word that describes you such as smart, fun or friendly.  (Feel free to be innovative.)

 

g)    Now go back to the I directory and then into the aint directory. 

 

h)    Create at least three directories.  The name of each directory should be a word that doesn’t describe you such as annoying, dumb and lame.  (Feel free to be innovative.)

 

i)       Now go back to the Me directory.

 

j)       Use the tree command.

 

k)     In Windows, do a screen capture of your outputted tree that should look like:

 


You can save the PNG of your screen capture in your me folder in case I ask to see it.

QUESTION 3 – DELETING FILES

 

Go inside the directory BestNESGame that is inside the Lesson02Work directory.

Use dir to see all files as well as all file sizes.

Use del to delete all files that have a size that is even.  This is the main purpose of the activity so please do not skip it.

Use
type on the remaining files to get the answer to the directory’s name.  Place your answer in a file named answer.txt that should be created inside the directory BestNESGame.

 

QUESTION 4 – DELETING DIRECTORIES

 

Go inside the BestRPG directory that is inside the Lesson02Work directory.

 

Look at the contents of the directory.

Delete all empty folders.  (You don’t even need to check if the folders are empty).

Now, you need to delete folder d.  Do this by using:

 

         rd /s d

 

The remaining two directories contain the name of the best RPG ever.  What is it?  Place your answer in a file named answer.txt that should be created inside the directory BestRPG.

 

separator-blank.png