简体   繁体   English

列出多个目录中的所有文件

[英]list all files in multiple directories

I would like to list all files in a certain directory, and list them with their full path. 我想列出某个目录中的所有文件,并列出其完整路径。

I have a series of directories like this: 我有一系列这样的目录:

user.newskims.131017222704/
user.newskims.131017222741/
user.newskims.131017222822/
user.newskims.131017222949/

If I do 如果我做

ls user.newskims.131017222*

The output has lines like this which I want to eliminate: 输出中有这样的行,我想消除:

user.newskims.131017222822:

It also doesn't give the full path. 它也没有给出完整的路径。 Is there a way to make it list all of the files inside, and only those files and no additional rows, and with the full path? 有没有办法让它列出其中的所有文件,并且仅列出那些文件,而不列出其他行,并列出完整路径?

您可以使用printf列出具有给定目录完整路径的文件:

printf "$PWD%s\n" user.newskims.131017222/*

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM