Why : How do I list only filenames in Cmd.exe under Windows?
solve : dir \a:-d \b
Extend Reading:
dir [Drive:] [Path] [FileName] [/a[[:]attributes]] [/b] [/C] [/d] [/L] [/n] [/o[[:]sortorder]] [/P] [/Q] [/S] [/t[[:]timefield]] [/w] [/x] [/4]
Part O:default Display
(Each column is modified date,modified time, File/dir attribute, file size, file/dir name)
2014/11/08 16:59 <DIR> .
2014/11/08 16:59 <DIR> .
2014/11/08 16:23 79,593 all.cmbd.aln
2014/11/08 16:23 2, 917 all.cmbd.dnd
2014/11/08 16:22 25,469 All.cmbd.fasta
2014/11/08 16:59 46,908 all.cmbd.notrim.me
2014/11/08 16:22 1,039 C.ele.cmbd.fasta
Part I: [Drive:][path][filename]
> Specify the drives, directories, files (win-dos common) to list
Part II: [/a[[:]attributes]]
/A attribute filter The files that make properties
d/d |
R/R |
h/h |
a/a |
archive archive file |
s/s |
system System file |
- |
= "not", "no" |
- DIR/A:D only show directory equivalent to ls-l under Linux/unix | egerp ' ^[^d] '
- dir/a:-d only displays all files that are not directories equal to Ls-l under Linux/unix | egrep ' ^d '
- Dir/a:-h only shows non-hidden files equivalent to ls-l under Linux/unix
- Dir shows that all file directories are equivalent to Ls-la under Linux/unix
Part III: [/b][/c][/d][/l][/n][/w]
/ b bis name displays only the file name and does not display the document information
/ C displays "thousand-bit Comma" (by default) in the File size column
/-c Disable the "thousand-bit comma"
/ D Divided and filled by Col and/b are the same, and only filenames are displayed, but columns are displayed by Col
/w divided and filled by row and/d are also displayed as columns, except that columns show by row
/ L lowercase lowercase display, all lowercase
/n new format, but nothing changed
part IV: [/o[[:]sortorders ]
n/n
Td>
order by name in ASCII file |
s/s |
order by size Size arrangement |
e/e |
order by Expansion arranges |
d/d |
g/g |
order by group |
|
&NBSP; |
Part V: [/p][/q][/s][/x]
/ P Pause split screen display, each return to move down one screen
/ q Displays the file directory owner, shown in the previous column of the filename
/ s displays files for the specified directory and all of its subdirectories
- DIR/S displays all files for the current directory and its subdirectories, and if the file and directory structure is complex, it will brush the screen
- DIR/S Edge Displays all files for the Edge directory and its subdirectories, suggesting
/ x Displays the short file name produced by the non- NTFS 8.3 filename (also known as short filename) , in the previous column of the file name
The format is as follows:
2014/11/07 00:14 568Rna42a~1.fasR.nor_pax3.pep.fasta
2014/11/07 00:13 430Rn0061~1.fasR.nor_pax4.pep.fasta
2014/11/07 00:16 477Rnor_p~1.fasR.nor_pax5.pep.fasta
2014/11/07 00:10 504Rnor_p~2.fasR.nor_pax6.pep.fasta
2014/11/07 00:15 591Rnor_p~3.fasR.nor_pax7.pep.fasta
2014/11/07 00:12 540Rnor_p~4.fasR.nor_pax8.pep.fasta
2014/11/07 00:16 426Rn1ba4~1.fasR.nor_pax9.pep.fasta
2014/11/07 00:09 1,687Rattus~1.txtRattus.norvegicus.txt
2014/11/08 16:16 560 test.pl
2014/11/08 16:22 4,014Xmaccm~1.fasX.mac.cmbd.fasta
2014/11/07 00:34 464Xmac_p~1.fasX.mac_pax1.pep.fasta
2014/11/07 00:31 394Xmac_p~2.fasX.mac_pax2a.pep.fasta
Part VI: [/t[[:]timefield]]
/C |
time when created created |
a/a |
time when last access occured |
w/w |
Time Operation last Write |
Part vii:useful Skills
- You can use the wildcard character */?
- * denotes one or more characters, remember that the asterisk wildcard always uses a short file name Mapping , so you may get unexpected results
- Dir *.fasta Displays all the file information that contains the. Fasta
- Dir *. * Displays file information with the. in file name.
- ? Only one character can be represented
- Using pipelines and redirecting,|,>,<,>>
- dir/a:-d/b | perl/python/cmds
- Set the default dir parameter
- environment variable Dircmd
Dir cmd, the dir Command, Windows