如何使用命令行将所有.pdf文件名打印到输出文件? [英] How do I print all .pdf files names to an output file with command line?

查看:218
本文介绍了如何使用命令行将所有.pdf文件名打印到输出文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这在Linux中似乎很容易,但是我试图将目录中的 *。pdf 文件名及其子目录打印到输出文件中。我在Windows机器上安装了Perl。

This seems easy in Linux, but I'm trying to print the names of *.pdf files within a directory and its subdirectories to an output file. I have Perl installed on my Windows machine.

有什么简单的方法?

推荐答案

与Linux没什么不同。

Not much different than Linux.

dir *.pdf > fileyouwant.txt

如果只需要文件名,则可以使用

If you only want the filenames, you can do that with

dir/b *.pdf > fileyouwant.txt

如果您还想要子目录,

dir/s/b *.pdf > fileyouwant.txt

如果您不在该目录中,以

If you aren't in that directory to start with

dir/s/b C:\Path\*.pdf > fileyouwant.txt

这篇关于如何使用命令行将所有.pdf文件名打印到输出文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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