![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-14 17:19 |
47,813 topics / 349,901 posts / today 3 new / 48,257 members |
| DOS学习入门 & 精彩文章 (教学室) » Ask a question, how to use DOS commands to view files |
| Printable Version 2,005 / 5 |
| Floor1 yangyulong | Posted 2004-06-05 00:00 |
| 初级用户 Posts 6 Credits 131 | |
|
Great expert: May I ask how to use DOS commands to view files? What are the commands? [em01]
|
|
| Floor2 sgy | Posted 2004-06-06 00:00 |
| 中级用户 Posts 51 Credits 323 | |
|
Dir
Displays a list of directory files and subdirectories. dir attributes]]sortorder]] timefield]] Parameters None If used without parameters or switches, dir displays the volume label and serial number of the disk, followed by a list of directories and files on the disk, including their names and the most recent modification date and time. dir can display the file extension as well as the file size in bytes. Dir also displays the total number of files and directories listed, the cumulative size, and the available space remaining on the disk (in bytes). Specifies the drive and directory to view the list of. Specifies a specific file or group of files to view the list of. Multiple filenames can be used. Filenames can be separated by spaces, commas, or semicolons. Wildcard characters (? and *) can be used in the filename parameter to display a group of files. /p Displays one screen of the list at a time. Press any key on the keyboard to view the next screen. /w Displays the list in wide format, showing up to 5 filenames or directory names per line. /d Same as /w, but files are sorted in columns. /aattributes] Displays only the names of directories and files with the specified attributes. If this switch is omitted, dir displays all filenames except hidden and system files. If this switch is used without specifying attributes, dir displays the names of all files, including hidden and system files. The following list describes each value that can be used for attributes. The colon (:) is optional. Use combinations of these values and do not separate them with spaces. Value Description h Hidden files s System files d Directories a Archiveable files (backups) r Read-only files -h Non-hidden files -s Files other than system files -d Only files (not directories) -a Files that have not been changed since the last backup -r Non-read-only files /o sortorder] Controls the order in which dir sorts and displays directory names and filenames. If this switch is omitted, dir displays names in the order they appear in the directory. If this switch is used without specifying sortorder, dir displays directory names in alphabetical order, followed by filenames in alphabetical order. The colon (:) is optional. The following list describes each value that can be used for sortorder. Use combinations of these values and do not separate them with spaces. Value Description n Alphabetical order by name e Alphabetical order by extension d By date and time, earliest first. s By size, smallest first g Directories grouped before files -n Reverse alphabetical order by name (from Z to A) -e Reverse alphabetical order by extension (from .ZZZ to .AAA) -d By date and time, latest first -s By size, largest first -g Directories grouped after files t timefield] The following list describes each value that can be used for timefield. Controls the time field to display or use for sorting. Value Description c Creation a Last access w Last write /s Lists each specified filename that appears in the specified directory and all subdirectories. /b Lists each directory name or filename, one per line (including the file extension). This switch does not display header information or summary. /b overrides the /w switch. /l Displays unsorted directory names and filenames in lowercase letters. This switch does not convert extended characters to lowercase. /n Displays the long list format with filenames on the far right. /x Displays the short names generated by files on NTFS and FAT volumes. Displays the same as the /n switch, but short names are displayed after long names. /c Displays multiple separators by file size. For more information, click Tree in the "Related Topics" list. Tree Graphically displays the directory structure of a path or drive's disk. tree Parameters drive: Specifies the drive containing the disk whose directory structure you want to display. path Specifies the directory whose directory structure you want to display. /f Displays the filenames in each directory. /a Specifies that tree uses text characters instead of graphic characters to display the lines that link subdirectories. |
|
| Floor3 yangyulong | Posted 2004-06-12 00:00 |
| 初级用户 Posts 6 Credits 131 | |
|
Thanks for writing so much.
|
|
| Floor4 谈笑风生123 | Posted 2004-06-13 00:00 |
| 初级用户 Posts 6 Credits 130 | |
|
There is also a command: attrib, which is used to view the attributes of all files and can also be used to modify them.
|
|
| Floor5 我心依然 | Posted 2004-06-13 00:00 |
| 初级用户 Posts 18 Credits 175 | |
| Floor6 六月飞雪 | Posted 2004-06-14 00:00 |
| 高级用户 Posts 201 Credits 893 | |
|
edit can view text files
|
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |