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-12 15:42
中国DOS联盟论坛 » DOS学习入门 & 精彩文章 (教学室) » One-line tip: ? and * View 1,710 Replies 2
Original Poster Posted 2002-11-18 00:00 ·  中国 广东 佛山 禅城区 电信
元老会员
★★★★
Credits 5,170
Posts 1,637
Joined 2002-10-16 00:00
23-year member
UID 8
Gender Male
From 广东佛山
Status Offline
? and * are both filename wildcards used by DOS. The difference is that one ? can stand for any one character in the current position, while * can stand for many characters.
For example, suppose the current directory has the following files

a.cab a1.bas b1.bas abcd.bas ab.bas

dir a?.bas will list a1.bas ab.bas
dir a*.bas will list a1.bas abcd.bas ab.bas
dir ?1.bas will list a1.bas b1.bas
dir *1.bas will list a1.bas b1.bas abcd.bas ab.bas, and the 1 after it has no effect here
dir *.* will list all files
我的网志
http://hzmys.blog.163.com/
我的网盘
firststep.qjwm.com
fsmys.ys168.com
ssmys.ys168.com
www.brsbox.com/fsmys
www.brsbox.com/ssmys
www.brsbox.com/ccdos
Floor 2 Posted 2003-06-07 00:00 ·  中国 辽宁 大连 联通
初级用户
Credits 113
Posts 2
Joined 2003-06-05 00:00
23-year member
UID 3677
Gender Male
Status Offline
Then what if it's dir *2.bas???
Floor 3 Posted 2003-06-07 00:00 ·  中国 香港
管理员
★★★★
專業島民
Credits 4,869
Posts 1,633
Joined 2002-12-10 00:00
23-year member
UID 465
Gender Male
Status Offline
The following is quoted from 凡秋 on 2003-6-7 8:28:47:
Then what if it's dir *2.bas???

Then it becomes dir *.bas.....
我的網站:http://mw16.2ya.com/ 我的網誌: http://scrappedblog.blogspot.com/
~
我的Winamp正在播放的歌曲:
Forum Jump: