Differences
This shows you the differences between two versions of the page.
en:docs:cmd:file:ranges [2014/05/24 08:48] – created valerius | en:docs:cmd:file:ranges [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Date, Time and Size Ranges ===== | ||
- | |||
- | Most internal commands which accept wildcards also allow date, time, and size ranges to further define the files that you wish to work with. **CMD.EXE** will examine each file's size and timestamp (a record of when the file was created, last modified, or last accessed) to determine if the file meets the range criteria you have specified. | ||
- | |||
- | (**CMD.EXE** also supports [[en: | ||
- | |||
- | A range begins with the switch character (**/**), followed by a left square bracket (" | ||
- | |||
- | All ranges are inclusive. For example, a size range which selects files from 10,000 to 20,000 bytes long will match files that are exactly 10,000 bytes and 20,000 bytes long, as well as all sizes in between; a date range that selects files last modified between 10-27-97 and 10-30-97 will include files modified on each of those dates, and on the two days in between. | ||
- | |||
- | If you reverse range start and end values the command processor will recognize the reversal, and will use the second (lower) value as the start point of the range and the first (higher) value as its end point. | ||
- | |||
- | See the individual range types for details on specifying ranges: | ||
- | |||
- | * [[en: | ||
- | * [[en: | ||
- | * [[en: | ||
- | |||
- | ==== Using Ranges ==== | ||
- | |||
- | If you combine two types of ranges, a file must satisfy both ranges to be included. For example, **/ | ||
- | |||
- | When you use a date, time, or size range in a command, it should immediately follow the command name. Unlike some command switches which apply to only part of the command line, the range usually applies to all file names specified for the command. Any exceptions are noted in the descriptions of individual commands. | ||
- | |||
- | For example, to get a directory of all the //*.C// files dated October 1, 1997, you could use this command: | ||
- | |||
- | < | ||
- | [c:\] dir / | ||
- | </ | ||
- | |||
- | To delete all of the 0-byte files on your hard disk, you could use this command: | ||
- | |||
- | < | ||
- | [c:\] del /[s0,0] *.* /s | ||
- | </ | ||
- | |||
- | And to copy all of the non-zero byte files that you changed yesterday or today to your floppy disk, you can use this command: | ||
- | |||
- | < | ||
- | [c:\] copy /[d-1] /[s1] *.* a: | ||
- | </ | ||
- | |||
- | The HPFS file system maintains 3 sets of dates and times for each file: creation, last access, and last write. By default, date and time ranges work with the last write time stamp. You can use the "last access" | ||
- | |||
- | < | ||
- | / | ||
- | </ | ||
- | |||
- | For example, to select files that were last accessed yesterday or today: | ||
- | |||
- | < | ||
- | /[da-1] | ||
- | </ | ||
- | |||
- | Date, time, and size ranges can be used with the [[en: | ||