dir 列出文件清单

您所在的位置:网站首页 dns的服务器不可用怎么解决移动网络 dir 列出文件清单

dir 列出文件清单

2024-07-12 10:01:46| 来源: 网络整理| 查看: 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 List Files According To Extension List 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 with dir command by providing related options. Some attributes file and folder may have are listed below;

文件和文件夹具有提供信息并存储有关它们的元数据的属性。 通过提供相关选项,可以使用dir命令列出这些属性。 下面列出了一些属性文件和文件夹:

Read

读 Write

写Hidden

隐Directory

目录…

… LEARN MORE  How To Linux Bash For Loop In Files? 了解更多信息如何在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 like below.

我们可能只需要打印目录而不包含文件。 这可以通过如下所示的“仅显示目录”属性来完成。

$ dir /A:D List Only Directories List 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:-D List Only Files List 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. These files 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.

Windows具有标记为系统文件作为属性的系统文件。 当使用/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 /Q Print Detailed Metadata For Files Print Detailed Metadata For Files 打印文件的详细元数据 列出文件和文件夹的创建时间(List Create Time of Files and Folders)

The file creation time can be listed with the /TC option.

可以使用/TC选项列出文件创建时间。

$ dir /TC List Created Time List 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 /TA List Last Accessed Time List Last Accessed Time 列出上次访问时间 查找上次修改时间(Find Last Modified Time)

Last modified time of the file can be listed with the /TW option.

文件的上次修改时间可以使用/ TW选项列出。

$ dir /TW Find Last Modified Time Find Last Modified Time 查找上次修改时间

翻译自: https://www.poftut.com/windows-dir-command-tutorial-examples-list-files-file-information/

dir 列出文件清单



【本文地址】

公司简介

联系我们

今日新闻


点击排行

实验室常用的仪器、试剂和
说到实验室常用到的东西,主要就分为仪器、试剂和耗
不用再找了,全球10大实验
01、赛默飞世尔科技(热电)Thermo Fisher Scientif
三代水柜的量产巅峰T-72坦
作者:寞寒最近,西边闹腾挺大,本来小寞以为忙完这
通风柜跟实验室通风系统有
说到通风柜跟实验室通风,不少人都纠结二者到底是不
集消毒杀菌、烘干收纳为一
厨房是家里细菌较多的地方,潮湿的环境、没有完全密
实验室设备之全钢实验台如
全钢实验台是实验室家具中较为重要的家具之一,很多

推荐新闻


图片新闻

实验室药品柜的特性有哪些
实验室药品柜是实验室家具的重要组成部分之一,主要
小学科学实验中有哪些教学
计算机 计算器 一般 打孔器 打气筒 仪器车 显微镜
实验室各种仪器原理动图讲
1.紫外分光光谱UV分析原理:吸收紫外光能量,引起分
高中化学常见仪器及实验装
1、可加热仪器:2、计量仪器:(1)仪器A的名称:量
微生物操作主要设备和器具
今天盘点一下微生物操作主要设备和器具,别嫌我啰嗦
浅谈通风柜使用基本常识
 众所周知,通风柜功能中最主要的就是排气功能。在

专题文章

    CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭