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
?
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
?
The
locate
database do not contain information other that names, so you should run some other tool, likels
, onlocate
outputPipe the output of
locate
toxargs
(addingls -l
as parameters toxargs
). This lets you use whatever options you need with either command. By also passing the-0
(dash-zero) option to both commands, you also protect against unintended interpretations of blanks or newlines in filenames. For example, to get the details of all .iso files on my system:Use a subshell
Or
You can add a function to ~/.bashrc if you wish
You then