Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

What do you think \" recursive delete\" means? To move up a directory, use cd ..

ID: 3746707 • Letter: W

Question

What do you think " recursive delete" means?

To move up a directory, use cd .. (as with Linux). Let’s go up two levels. Recall to use instead of /. 38.) What command did you enter? Enter dir. 39.) In what directory are in you now in? What does your prompt say? Change directory to /Windows/System32. Do a directory listing.

The following commands are similar:

Linux commands:         mv, cp, rm, man, mkdir, rmdir:

Window commands:     move, copy, del, help, mkdir, rmdir


Change directory to your Documents subdirectory within your home directory. 40.) What command(s) did you use? Type dir to see what files are there. There should be two. Delete the file foo.txt. 41.) What command did you use?

Create a subdirectory called temp2. 42.) What command did you enter? Copy the file foo1.txt into temp2 using the copy command. 43.) What command did you enter? Switch to your temp2 directory. Using move, rename this file to be foo3.txt. 44.) What command did you enter? Move up one directory (up to documents). Attempt to delete the temp2 directory. 45.) What command did you enter? What happened?

Explanation / Answer

//note $ is the prompt given don't copy that along with command when executing commands on your //prompt

Recursive delete means , it deletes all the files and sub directories nested within directory you are giving as parameter to the command rm

Example

rm -rf test

It deletes all the files and sub directries present under directory namd test

-------------------------------------------

to go up one level we use .. , to go up two levels we use ../.. as below

cd ../../

Then type dir to list the files under that directory

For my system I got following after dir execution

If you have more files two level up your current directory , it display for you.

------------------------------------------------------------------------------

to change directory to Change directory to /Windows/System32 , type the command as below

$cd  /Windows/System32

Then type command dir

$dir

You see the files under your present directory

Now to change to subdirectory use following commans, I am using subdirectory name as yourSubdirname, you can use exact name there

40) $ cd yourSubdirname

type dir

$dir

it lists files you have in that

To delete foo.txt use below command

41) $ rm foo.txt

To create a subdirectory named temp2

42) $mkdir temp2

Copy file foo.txt to temp2 directory

43) $cp foo.txt temp2

u can just give relative path as temp2 is in subdirectory in current directory.

------------------------------------

Switch to your temp2 directory. Using move, rename this file to be foo3.txt.Execute below listed commands to achieve this

44)

$cd temp2

mv foo.txt foo3.txt

-------------------------------------------

Move up one directory (up to documents). Attempt to delete the temp2 directory.

45) to move up one directory

$cd ..

Then try to delete the temp2 directory from present directory

$rm temp2

since temp2 is not empty , you get error saying

to remove temp2 recursively , you can use

$ rm -rf test

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote