命令提示符中树的输出 [英] Output of tree in command prompt

查看:32
本文介绍了命令提示符中树的输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够使用

tree /F /A > "desktop"file.txt

命令仅输出文本文件.目前,它输出每个文件扩展名.

command to output only text files. Currently as is, it outputs every file extension.

有谁知道一种简单的方法来做到这一点?

Does anyone know of an easy way to do this?

推荐答案

Tree 只接受几个命令行参数:

Tree accepts only a few command line parameters:

c:>Tree /?
Graphically displays the folder structure of a drive or path.

TREE [drive:][path] [/F] [/A]

   /F   Display the names of the files in each folder.
   /A   Use ASCII instead of extended characters.

指示的参数都不是文件掩码或过滤器.

None of the indicated parameters are a file mask or filter.

您可以使用带有适当开关的 dir,并将输出重定向到文本文件.您将获得文件的完整路径名,但如果需要,您可以在以后的处理中使用 for 循环将其过滤掉:

You can use dir with the proper switches, and redirect the output to a text file. You'll get the full path name to the files, but you can filter that out in later processing if need be with a for loop:

C:>dir *.txt /s /b > filelist.txt

这篇关于命令提示符中树的输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆