DOS MD and RD command usage instructions

Source: Internet
Author: User
Tags create directory root directory

I wonder if you have any idea where all these directories on the disk come from? In fact, these directories are created by ourselves, we created these directories to classify the organization files, if we have a new category of files, we need to create a new directory. The two commands we're going to learn today are directory operations, which are MD (make directory--Create directory) and RD (remove directory--Delete directory).

These two commands are very simple, such as my name is Dr. Xiao, I want to put my own files in a directory, I can enter the MD xbs, build my directory. When you take a look at the dir command, you will find that there is a more directory Xbs in the root directory.

You might as well practice, build a directory called XYZ, and enter Dir to see the XYZ directory, and if you see it, you will succeed (Oh, this lesson is half done). Now let's go to this directory and type cd xyz, and notice if the prompts have changed. OK, enter the dir command. It's weird, isn't it? We have just built this directory, which logically says there should be nothing in this directory. In fact, no matter what directory you build, this. will appear in the table of contents because. Represents the directory itself,.. Represents the upper-level directory for this directory. Obviously, since a directory already exists, it is impossible not to have itself, and it is impossible to have no previous directory. (.. You've used it, remember? It's a CD., used to return to the previous level of the directory.

Practice again, create a directory in the XYZ directory: ABC, (the correct way is to enter MD ABC) with the dir command look, the ABC directory shows that you have successfully learned to build the directory.

Since you can create a catalog, you can also delete it, and the RD command is to do the job. For example, if you want to delete the ABC directory, enter rd ABC. Don't believe it again with the dir command to see if the ABC directory is gone. Is it easy to delete a subdirectory under the current directory, enter the RD space plus the subdirectory name to complete the task.

However, use the RD command to pay attention to a few issues (or you delete a lifetime also do not want to remove certain directories), take a good look at the following points:

Now you practice again (this time you're successful, you're done, you can learn the next lesson), what if you want to delete the XYZ directory where you are now?

Correct answer: Enter CD. command to return to the previous level directory, and then enter RD XYZ to remove the XYZ directory.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.