![]() C:\docs\>dir /a:-ar This would return every file in the C:\DOCS subdirectory that was read-only and already backed up. So, if you wanted to find all the files you not yet backed up, you would use a command like this: C:\>dir /a:a Every file in the root directory with the archive bit set “on” would be returned by this command. You can enter as many attributes as you like in order, without leaving a space between them. The syntax for this is the DIR command, followed by a space, then /A:, which signals an attribute argument, followed by the specific attribute(s) you want to search for. You can also use the DIR command with an Attribute argument to find files that match the attribute selected. ![]() Better to not make a mistake in the first place.) DIR with Attributes (There are DOS utilities to “undelete” a file, but they are uncertain. Remember that DOS does not have a Recycle Bin, so when you delete a file it may very well be unrecoverable. This can be very handy in a large directory to check for files, or to make sure before using a DEL command with wildcards that you know exactly what you are deleting. You can use all of the DOS Wildcards we discussed in the last lesson to find specific files. C:\>dir memo?.* This command would return a list of all files in the root directory with names that begin with MEMO, have one additional character following in the name, and have any extension at all. For instance, you can use wildcards to search for a file that matches certain characters: C:\>dir *.doc This command would return a list of all the files in the root directory with the DOC extension. ![]() But with a few arguments it becomes a search tool that works much like the Windows Find tool. If the DIR command is given without any arguments, it returns a list of all files in the subdirectory. The DIR command is generally used to get a listing of all of the files in given subdirectory. In this lesson we put some of these pieces together and learn how to use the DIR command like an expert. In previous lessons we looked at some of the commands used to manipulate directories, and at the DOS Wildcards and File Attributes. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |