1

with the following command:

    find /tmp  -depth -name file

I get the:

   /tmp/file
   /tmp/test_file/file

But what I need to add to find command in order to get the following print?

   file=/tmp/file
   file=/tmp/test_file/file
klod
  • 195

1 Answers1

3

Maybe with the printf option:

find /tmp -depth -name "file" -printf "file=%h/%f\n"

Sven
  • 99,533
  • 15
  • 182
  • 228
  • What is the ampersand for? I get a literal one in the output. You could use %p instead of %h/%f. – Dennis Williamson Jan 25 '11 at 16:47
  • Don't know where the & comes from, must slipped in while editing the line ;) I somehow like separating path and filename, not exactly sure why, but yes, %p would also work. – Sven Jan 25 '11 at 16:54