How do I print all .pdf files names to an output file with command line?

前端 未结 5 1200
逝去的感伤
逝去的感伤 2021-02-04 08:53

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

5条回答
  •  失恋的感觉
    2021-02-04 09:40

    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
    

    If you also want subdirs,

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

    If you aren't in that directory to start with

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

提交回复
热议问题