Precautions for Windows CMD file management

Source: Internet
Author: User


Note the following when using the Windows CMD command line to manage and organize files:
The predecessor of Windows is MS-DOS, which manages commands for files and folders in the 8.3 format, that is, to add 3 extensions to 8 main file names in the most extreme circumstances, similar to: Abcdefg. hik. For a non-standard file name, such as a long file name with an extension or a file name with some special symbols, it will be mapped to a "valid" 8.3 format during production, for example, to create a text file, right-click the file and select "Text Document" under the "new" submenu. a "new text file .txt" is generated, for Windows, the main file name has been more than 8 characters (a Chinese character is equal to two characters), it will automatically generate a standard 8.3 format file name in the background to match it. Of course, this is transparent for the operator and we don't need to care about it. The file name we usually see when operating these files is also "Create a text file TXT", rather than a new name given by Windows. Even if we go back to the CMD command line environment and use DIR to view it, it is also concealed by Windows. Www.2cto.com
Since we cannot see this change, and the normal operation will not have any impact, why should we pay attention to this problem? Here is an example:
In a folder, there are more than 10 thousand similar files: a.txt0000b.txta,c.txt,d.txt B ...... They have the same name, and the extension names all contain "txt ". Now, to delete a file with the extension TXT, the corresponding file is a.txt0000c.txt ......, In Windows window mode, it is extremely inefficient to manually select so many 10 thousand files with the mouse. It takes a long time for the system to display these files. So what will happen if you use CMD? It's easy to think of a command like Del *. txt www.2cto.com: that is to say, to delete a file with the extension TXT, the command looks like this, which meets the requirements, but after the execution is completed instantly (it is really efficient ......), DIR look? The folder is empty ...... That is to say, this command not only clears. txt, even. txta is not used, but we didn't add the "*" wildcard at the end of the original command. Since the other file names have four characters, how can we add a limit to it? Del *.??? After the execution, you will be very disappointed. It is also a blank folder for you. Note that Cmd does not have the concept of "recycle bin". That is to say, these files disappear from the file allocation table at this moment (just like clearing the "recycle bin, it does not physically disappear .) ......
So, B .txta,d.txt B ...... What are these files for the operating system? Let's take a look at some of their hidden things in Windows ......
Let's look at the help of the DIR command. It has a parameter x. Let's make a Dir/x for the corresponding example B .txta,d.txt B. "file: 3 B80F3 ~ 1. TXT B .txt A2011-03-27 3 D98F3 ~ 1. the first two columns of TXT D.txt B are the file creation date, the second column is the creation time, the third column is the file length, and the fifth column is the file name we can see, what is the fourth column? They are some weird names. They are the names automatically generated by the system for these non-8.3 file names. We will not discuss how to generate these files. Let's take a look at the file name: B80F3 ~ 1. TXT, D98F3 ~ 1. TXT ...... All extensions are. TXT. Familiar with it? Isn't the command we gave exactly Del *. txt? Therefore, the Del command directly flushed these files without hesitation ......, That is to say, today, some old-level code remains in the Windows operating system, and sometimes they will surprise you ...... Then, how can we avoid these troubles? The following is a reference ......

Author: Quiet night breeze

Related Article

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.