15.01.2024 Views

CompTIA A+ Certification All-in-One Exam Guide

  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

works in Windows.

So, with that in mind, let’s get rid of some folders. It’s actually quite

simple. In this example, let’s use Linux as an example to delete the files

subdirectory in our ~/practice directory (remember ~ means your home

directory). First, get to where the files subdirectory is located—~/practice—

by typing cd practice (make sure you’re in your home directory first). Then

type rmdir files. If you received no response, you probably did it right! Type

ls to check that the files subdirectory is gone. Windows works exactly the

same, although we tend to use the rd command more often, simply because

it’s faster to type.

The rmdir/rd command alone will not delete a directory if the directory

contains files or subdirectories. If you want to delete a directory that contains

files or subdirectories, you must first empty that directory. However,

Windows folks can use the rd command followed by the /s switch to delete a

directory as well as all files and subdirectories. The rd command followed by

the /s switch is handy but dangerous, because it’s easy to delete more than

you want. There is no Recycle Bin when deleting from the command line, so

when deleting, always follow the maxim “Check twice and delete once.”

Let’s delete the practice and games directories with rd followed by the /s

switch. Because the practice directory is in your home directory, point to it

with cd \Users\<your username>. Now execute the command rd practice /s.

In a rare display of mercy, Windows responds with the following:

Press the y key and both C:\Users\mike\practice and

C:\Users\mike\practice\games are eliminated.

EXAM TIP Make sure you know how to use md, mkdir, rd, rmdir, rm, and

cd for the CompTIA A+ 220-1002 exam.

Want to remove a folder and all of its contents in Linux? No problem, but

we don’t use rmdir. Instead we turn to the very handy rm command. (More

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!