Friday, September 28

Removing (or Deleting) directories

RD or RMDIR
RD or RMDIR command removes an empty directory from the parent directory.
Point to remember :

  • All files should be deleted from the current directory to make it empty.
  • An empty directory can only be removed from the parent directory.
  • The root directory can not be removed.
Syntax
RMDIR [drive:] path  
RD [drive:] [path]
where,
RMDIR :  Remove Directory
RD        :   abbreviated version of RMDIR
[drive:]    : drive from which the directory is to be deleted.
path        :  location of the directory to be deleted.
Example 1
C:\>RD CLASS10 (press enter key)
It deletes (or removes) sub directory CLASS10 from the root directory.
Example 2
C:\>RD CLASS8\SAKET
It removes sub directory SAKET of parent directory CLASS8.
Similarly,
C:\>RD CLASS8
CLASS8 directory will be deleted.

To remove the sub directory CLASS9
(I) First, you have to delete all files inside the sub directory SUMA,
To perform this, first enter into directory SUMA as :
C:\>CD CLASS9\SUMA (press enter key) 
C:\>CLASS 9\SUMA>
Use command to delete files C:\CLASS9\SUMA>DEL*.* (press enter key)  
(II) To remove sub directory SUMA, change to its parent directory
C:\CLASS9\SUMA>CD.. (press enter key)
(III) To delete sub directory CLASS9 of root directory change to the root
C:\>CLASS9>CD.. (press enter key)
Use the command C:\>RD CLASS9 (press enter key)
C:\>DIR (press enter key)
It will show the directory CLASS8, CLASS9 or CLASS10 all are deleted.
C:\>RD A:\CLASS9
It deletes the sub directory CLASS9 of A: drive from C: drive.

No comments:

Post a Comment