user788171
user788171

Reputation: 17553

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?

Upvotes: 2

Views: 3447

Answers (1)

anubhava
anubhava

Reputation: 785058

You can list file with full path of a given directory using printf:

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

Upvotes: 1

Related Questions