1

I need to store the full path of a specific file found through find (and successive piped operations on find results). I'm using this:

find "$PWD" . -iname p_*.raw -printf "%Tc %p\n" | sort  | cut -f 7 -d " " 

However, as it is it produces shortened file paths "$PWD" doesn't seem to have any effect. Is there any way to force it to show full path?

1 Answers1

0

Your solution is close.

You are telling find where to look twice, "$PWD" and .. Drop the second one and add a slash to the first. Add quotes around the name pattern as well.

find "$PWD/" -iname "p_*.raw" ....

You might have an issue with the cut command as well, since it's only selecting one field rather than name and time. Still, your attempt is almost there.

Chindraba
  • 2,058