0

I have a set of directories with files and I want to get a clean list of the absolute paths of all the files in these directories, something like this Having

\home\me\DirA\
          fileA
          fileB
          some_directory_that_i_dont_want_listed

\home\me\DirB\
          fileB
          fileC

.... \home\me\DirXYZ\ fileOPQ

and get

\home\me\DirA\fileA
\home\me\DirA\fileB
\home\me\DirB\fileB
\home\me\DirXYZ\fileOPQ

Is this possible with a ls command?, I've tried ls with -R but it lists only the filenames.

2 Answers 2

1

Try this command:

$ find /home/me/Dir[AB]

Hope this helps! :)

1
  • Didn't think of find. But what I needed is a more generic thing (not only for DirA and DirB but your answer gives me ideas to investigate. I will edit the example to make it more clear.
    – tru7
    Commented Feb 10, 2017 at 9:28
0

For the case it's of use to anyone, it's simple

find /home/me

lists everything with absolute paths.

If you need to filter a specific extension

find /home/me -name *.someExt
0

Not the answer you're looking for? Browse other questions tagged or ask your own question.