2023年7月3日发(作者:)
dir列出⽂件清单_WindowsDir命令教程,以列出⽂件和⽂件信息的⽰例dir 列出⽂件清单Dir command is one of the most used Windows commands. Dir is used mainly to list files and directories in Windowsoperating systems. In this tutorial, we will look at different usage examples of the dir 命令是最常⽤的Windows命令之⼀。 Dir主要⽤于列出Windows操作系统中的⽂件和⽬录。 在本教程中,我们将查看dir命令的不同⽤法⽰例。列出⽂件和⽂件夹 (List Files and Folders)Without providing any option and parameter we will list all files and folders in the current working path. The current workingpath is the path where the shell currently locates. While printing files and folders there is also information like Volume nameand Volume Serial Number.在不提供任何选项和参数的情况下,我们将列出当前⼯作路径中的所有⽂件和⽂件夹。 当前⼯作路径是外壳当前所在的路径。 在打印⽂件和⽂件夹时,还有诸如卷名和卷序列号之类的信息。$ dirList Files and Folders列出⽂件和⽂件夹列出⽂件和⽂件夹的裸格式(List Files and Folders Bare Format)The bare format will only provide files and folders. There will be no other information like creation date-time file type etc. Wewill provide the /b option.裸格式将仅提供⽂件和⽂件夹。 将没有其他信息,例如创建⽇期时间⽂件类型等。我们将提供/b选项。$ dir /bList Files and Folders Bare Format列出⽂件和⽂件夹的裸格式递归列出⽂件(List Files Recursively)The default behavior is listing only the current working directory. Listing subdirectories is a need some times. This can bedone with /s option like below.默认⾏为是仅列出当前⼯作⽬录。 列出⼦⽬录有时是需要的。 可以使⽤/s选项(如下所⽰)完成此操作。$ dir /s根据扩展名列出⽂件 (List Files According To Extension)Another useful feature is listing files and directories with regular expressions or similar glob presentations. One of the mostused wanted situations is listing files and folders according to their extension. In this example, we will list txt extension byusing wildcard.另⼀个有⽤的功能是使⽤正则表达式或类似的glob表⽰形式列出⽂件和⽬录。 最常⽤的通缉情况之⼀是根据⽂件和⽂件夹的扩展名列出它们。 在此⽰例中,我们将使⽤通配符列出txt扩展名。$ dir *.txtList Files According To Extension根据扩展名列出⽂件列出JPEG⽂件(List JPEG Files)We can list jpeg files with the following command.我们可以使⽤以下命令列出jpeg⽂件。$ dir *.jpeg列出Excel(xls)⽂件 (List Excel (xls) Files)We can list Excel files with the following command.我们可以使⽤以下命令列出Excel⽂件。$ dir *.xls列出Word(doc)⽂件 (List Word (doc) Files)We can list Word files with the following command.我们可以使⽤以下命令列出Word⽂件。$ dir *.doc⽂件和⽂件夹属性 (File and Folder Attributes)Files and folder have attributes to provide information and store metadata about them. These attributes can be listed withdir command by providing related options. Some attributes file and folder may have are listed below;⽂件和⽂件夹具有提供信息并存储有关它们的元数据的属性。 通过提供相关选项,可以使⽤dir命令列出这些属性。 下⾯列出了⼀些属性⽂件和⽂件夹:Read读Write写Hidden隐Directory⽬录……了解更多信息如何在Linux Bash中循环⽂件?仅列出⽬录 (List Only Directories)We may need to print only directories and do not include files. This can be done with the display only directory attribute likebelow.我们可能只需要打印⽬录⽽不包含⽂件。 这可以通过如下所⽰的“仅显⽰⽬录”属性来完成。$ dir /A:DList Only Directories仅列出⽬录仅列出⽂件(List Only Files)We will use directory attribute but we will negate the attribute and this will only display the non directory files. We will use /A:-D option .我们将使⽤⽬录属性,但是将使属性⽆效,这将仅显⽰⾮⽬录⽂件。 我们将使⽤/A:-D选项。$ dir /A:-DList Only Files仅列出⽂件列出只读⽂件(List Read Only Files)In windows systems, files can be read, write, append, etc. To protect files for changes some files are made read-only. Thesefiles can be listed by using read-only attributes with /A:R.在Windows系统中,可以读取,写⼊,追加等⽂件。为了保护⽂件不被更改,某些⽂件被设为只读。 可以通过对/A:R使⽤只读属性来列出这些⽂件。$ dir /A:R列出隐藏⽂件 (List Hidden Files)Hidden files can be listed with the /A:H option.可以使⽤/A:H选项列出隐藏的⽂件。$dir /A:H排除只读⽂件 (Exclude Read Only Files)Read only files can be excluded by negating the normal usage like below.通过取消如下所⽰的常规⽤法,可以排除只读⽂件。$ dir /A:-R排除系统⽂件 (Excludes System Files)Windows have system files that have tagged as system files as an attribute. We can exclude system files while listing with/A:-s具有标记为系统⽂件作为属性的系统⽂件。 当使⽤/A:-S列出时,我们可以排除系统⽂件。$ dir /A:-S打印⽂件的详细元数据 (Print Detailed Metadata For Files)Meta data about files and folder can be printed with /Q option. This will also list file ownership.可以使⽤/Q选项打印有关⽂件和⽂件夹的元数据。 这还将列出⽂件所有权。$ dir /QPrint Detailed Metadata For Files打印⽂件的详细元数据列出⽂件和⽂件夹的创建时间(List Create Time of Files and Folders)The file creation time can be listed with the /TC option.可以使⽤/TC选项列出⽂件创建时间。$ dir /TCList Created Time列出创建时间列出上次访问时间(List Last Accessed Time)Files are accessed during time these access time can be printed with the /TA option like below.在访问期间,可以使⽤/ TA选项打印这些访问时间,如下所⽰。$ dir /TAList Last Accessed Time列出上次访问时间查找上次修改时间(Find Last Modified Time)Last modified time of the file can be listed with the /TW option.⽂件的上次修改时间可以使⽤/ TW选项列出。$ dir /TWFind Last Modified Time查找上次修改时间dir 列出⽂件清单
发布者:admin,转转请注明出处:http://www.yc00.com/news/1688382322a129639.html
评论列表(0条)