tags:

views:

155

answers:

2

Hey dudes,

This question is quite similar to http://stackoverflow.com/questions/246215/how-can-i-list-files-with-their-absolute-path-in-linux

I want to get the name of file or folder with absolute path and date modified.

This command almost does it:

ls -lR /foo/bar | awk '{print $6,$7,$8,$9}'

But it doesnt show the absolute path.

Regards Stollan

+4  A: 

check out the find command and its printf option. Eg only

find /foo/bar -printf "%p %A@" 

see the man page of find for more

ghostdog74
`find /directory -name "hello" -type f -print -exec date -r {} +%Y/%D:%H:%M \;` another way, won't give it as answer because yours is good.
Anders
You might want a `\n`. `%A` is access time - the OP asked for modified time which is `%T`. The `@` gives seconds since the epoch. If you want a more human-readable date/time, use: `%T+` or `%TY-%Tm-%Td %TX` or similar. I'd put the date first for easier fixed-width parsing. So, finally: `find /foo/bar -printf "%TY-%Tm-%Td %TX\t%p\n"`
Dennis Williamson
A: 

Try this: http://stackoverflow.com/questions/246215/how-can-i-list-files-with-their-absolute-path-in-linux

karlphillip
The OP posted that link in the question!
Dennis Williamson
Yes, but its not clear if he posted before me.
karlphillip