Stollan
Stollan

Reputation: 113

List files with absolute path recursive in linux

This question is quite similar to 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

Upvotes: 11

Views: 28841

Answers (3)

ghostdog74
ghostdog74

Reputation: 342363

Check out the find command and its printf option.

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

See the man page of find for more information.

Upvotes: 13

brokengillou
brokengillou

Reputation: 1

After reading some partial solutions no recursion, partial date format, no pipe... my proposition is from the target folder:

find . -type f -exec ls -lAoUtTh {} \; | awk '{print $9"\t"$5"\/"$6"\/"$8"\t"$7"\t"$4}' | grep -E -i '.*\.fcp\b|.*\.omf\b'

Works well thanks to contributors but very slowly basicly me.

Gilles

OsX Darwin 10.8 bash

Upvotes: -1

Dan Mantyla
Dan Mantyla

Reputation: 1870

I like to use:

ls -d -1 $PWD/**

Upvotes: -1

Related Questions