dir 列出文件清单

您所在的位置:网站首页 dir软件完 dir 列出文件清单

dir 列出文件清单

2023-09-12 07:25| 来源: 网络整理| 查看: 265

dir 列出文件清单

dir 列出文件清单

Dir command is one of the most used Windows commands. Dir is used mainly to list files and directories in Windows operating systems. In this tutorial, we will look at different usage examples of the dir command.

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 working path is the path where the shell currently locates. While printing files and folders there is also information like Volume name and Volume Serial Number.

在不提供任何选项和参数的情况下,我们将列出当前工作路径中的所有文件和文件夹。 当前工作路径是外壳当前所在的路径。 在打印文件和文件夹时,还有诸如卷名和卷序列号之类的信息。

$ dir List Files and Folders List 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. We will provide the /b option.

裸格式将仅提供文件和文件夹。 将没有其他信息,例如创建日期时间文件类型等。我们将提供/b选项。

$ dir /b List Files and Folders Bare Format List 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 be done 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 most used wanted situations is listing files and folders according to their extension. In this example, we will list txt extension by using wildcard.

另一个有用的功能是使用正则表达式或类似的glob表示形式列出文件和目录。 最常用的通缉情况之一是根据文件和文件夹的扩展名列出它们。 在此示例中,我们将使用通配符列出txt扩展名。

$ dir *.txt


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3