纯文本文件中所有文件的索引名称

纯文本文件中所有文件的索引名称

我的这个目录充满了图像,我可以这样做:

echo *.jpg
image1.jpg image2.jpg image3.jpg # and so on

如何获得这种格式的纯文本文件的输出?

image1.jpg
image2.jpg
image3.jpg

ベストアンサー1

避免使用lsbash glob 可以做得更好

printf '%s\n' *.jpg >output_file

おすすめ記事