Dir cmd, the dir Command, Windows

Source: Internet
Author: User

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"

    1. DIR/A:D only show directory equivalent to ls-l under Linux/unix | egerp ' ^[^d] '
    2. dir/a:-d only displays all files that are not directories equal to Ls-l under Linux/unix | egrep ' ^d '
    3. Dir/a:-h only shows non-hidden files equivalent to ls-l under Linux/unix
    4. 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

    1. 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
    2. 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

    1. You can use the wildcard character */?
      1. * denotes one or more characters, remember that the asterisk wildcard always uses a short file name Mapping , so you may get unexpected results
        1. Dir *.fasta Displays all the file information that contains the. Fasta
        2. Dir *. * Displays file information with the. in file name.
      2. ? Only one character can be represented
    2. Using pipelines and redirecting,|,>,<,>>
      1. dir/a:-d/b | perl/python/cmds
    3. Set the default dir parameter
      1. environment variable Dircmd

Dir cmd, the dir Command, Windows

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.