Can I use a flag like -l from ls with find or locate?
Not just for "ls -l" but for whatever action you'd want to perform to your locate or find results you can use xargs or in the case of find the -exec flag. Here are examples to achieve what you want to do:
In the case of locate you can use xargs:
locate something | xargs ls -l
Xargs can be used for find too, but find has the -exec flag that allow to optimize further actions with find results; for example
find . -iname something -exec ls -l '{}' \;
I am not sure what you want to do, but try
find . -ls
You can use -printf
and a suitable format string
find ./ -printf "%M\t%n\t%u\t%g\t%s\t%t%f\n"
- %M Symbolic permissions
- %n hard links
- %u username or numeric user id
- %g group name or numeric group id
- %s file size in bytes
- %t last modification time
- %f filename