Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 3200  / 2 Years ago, tue, september 27, 2022, 9:21:52

When I run the ls -l command I get details about the files in the current directory like permissions, owner, group, file size.



Is there a way I can get these same details instead of just the location of the file when I run locate?


More From » bash

 Answers
4

The locate database do not contain information other that names, so you should run some other tool, like ls, on locate output



lsloc() {
locate "$@" |
while read -r name; do
ls -ld "$name"
done
}
lsloc pattern

[#41252] Wednesday, September 28, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rinstracte

Total Points: 221
Total Questions: 114
Total Answers: 120

Location: France
Member since Fri, Jan 28, 2022
2 Years ago
;