cmd - Win10 CMD 只导出目录和子目录中的文件名
问题描述
我想用 Win10 CMD 解压到一个txt文件,只有目录和子目录中的文件名。
我最接近的是
V:\Scanned Pictures>dir *.jpg /s/d/a:-d "folderpath" > test1.txt
它只列出文件名,但还包括目录的“标题”,如:
================================================================= Not wanted
Volume in drive V is Pictures
Volume Serial Number is C1FA-29F2
Directory of V:\Scanned Pictures\1988-06 California trip
================================================================= Not Wanted
1988-06 California trip Kathleen Beach 1.jpg <<<-- Just the file name
解决方案
只需添加 /b 选项
dir *.jpg /b/s/d/a:-d "folderpath" > test1.txt
根据目录/?信息,/b 使 dir 显示无标题或摘要的裸格式
推荐阅读
- c++ - Clang-Format 没有正确对齐函数参数
- docker - 无法创建 Dockerfile 映像 /bin/sh: apt-get: not found
- c# - 有什么方法可以禁用继承属性的验证?
- ios - 来自 Realm DB 的 SwiftUI 列表
- javascript - 在 useState 挂钩中同步对象内的嵌套数组
- javascript - 将侦听器添加到仅使用 Javascript 关闭的引导模式
- python - 使用 UNSW-NB15 数据集奇怪输出的 Keras 分类模型
- sql - 如何逐级验证从给定底部叶子开始直到到达根的父级?
- reactjs - Wifi Direct 反应原生
- c# - 有人可以向我解释我的代码有什么问题吗?