China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-13 19:29
中国DOS联盟论坛 » DOS学习入门 & 精彩文章 (教学室) » Ask a question, how to use DOS commands to view files View 2,001 Replies 5
Original Poster Posted 2004-06-05 00:00 ·  中国 湖北 荆门 移动
初级用户
Credits 131
Posts 6
Joined 2004-06-05 00:00
22-year member
UID 26095
Gender Male
Status Offline
Great expert: May I ask how to use DOS commands to view files? What are the commands? [em01]
Floor 2 Posted 2004-06-06 00:00 ·  中国 重庆 教育网
中级用户
★★
Credits 323
Posts 51
Joined 2004-03-15 00:00
22-year member
UID 20174
Gender Male
Status Offline
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.
Floor 3 Posted 2004-06-12 00:00 ·  中国 湖北 荆门 沙洋县 电信
初级用户
Credits 131
Posts 6
Joined 2004-06-05 00:00
22-year member
UID 26095
Gender Male
Status Offline
Thanks for writing so much.
Floor 4 Posted 2004-06-13 00:00 ·  中国 四川 绵阳 电信
初级用户
Credits 130
Posts 6
Joined 2004-05-25 00:00
22-year member
UID 25265
Gender Male
Status Offline
There is also a command: attrib, which is used to view the attributes of all files and can also be used to modify them.
请多多帮忙,谢谢谢谢!
Floor 5 Posted 2004-06-13 00:00 ·  中国 河北 唐山 联通
初级用户
Credits 175
Posts 18
Joined 2004-06-13 00:00
22-year member
UID 26609
Gender Male
Status Offline
Floor 6 Posted 2004-06-14 00:00 ·  中国 北京 中移铁通
高级用户
★★
游客隐者
Credits 893
Posts 201
Joined 2004-04-27 00:00
22-year member
UID 23335
Gender Male
Status Offline
edit can view text files
^-^ 党和国家教导我们,看帖一定要回帖,做一个文明的网民.
Forum Jump: