I'm gonna go out on a limb and say find might cover the first, and probably the second. As for showing file permissions, I know there's another command for that, but alas, I only woke up an hour ago. I need brain food! Ask @BigEclipse
The idea is that I want to search through many sub-folders for a particular file I know to be in many locations and double-check the file permissions of those files all in one go.
It's a security thing - just want to make sure I haven't left permissions incorrect on a web server.
I think the problem is that I'm talking about hundreds of files here, so I can locate all of them, but if I have to ls /path on each one it will take ages
17 comments so far
Try channel #linux...
10 months, 1 week ago by map
Thanks @map :)
I'll post there now.
10 months, 1 week ago by alexleonard
I'm gonna go out on a limb and say find might cover the first, and probably the second. As for showing file permissions, I know there's another command for that, but alas, I only woke up an hour ago. I need brain food! Ask @BigEclipse
10 months, 1 week ago by edythemighty
ls -l displays permissions. Use chmod to change them. Not sure what you mean by "display" location. After finding, just use cd to get there.
10 months, 1 week ago by BigEclipse
@alexleonard: Here is a more organized and descriptive article. Gotta love IBM's *nix articles :3
10 months, 1 week ago by edythemighty
Thanks guys - I'll test those out.
The idea is that I want to search through many sub-folders for a particular file I know to be in many locations and double-check the file permissions of those files all in one go.
It's a security thing - just want to make sure I haven't left permissions incorrect on a web server.
10 months, 1 week ago by alexleonard
So I might need to do something like
find . -name [filename] -exec ls -l {} \;
10 months, 1 week ago by alexleonard
It'd look like: ls -l filename.ext or locate filename.
10 months, 1 week ago by BigEclipse
Oh right, and does ls do listing of stuff below your current dir? I had assumed it just listed everything in the current dir?
10 months, 1 week ago by alexleonard
locate lists everything in all directories.
10 months, 1 week ago by BigEclipse
and does locate allow me to exec an ls -l query as well?
10 months, 1 week ago by alexleonard
locate to find file.
ls /pathwhereitis to see permissions ;)
10 months, 1 week ago by bubu1uk
I think the problem is that I'm talking about hundreds of files here, so I can locate all of them, but if I have to ls /path on each one it will take ages
10 months, 1 week ago by alexleonard
what exact file u'r looking for?
10 months, 1 week ago by bubu1uk
Yeah, that is the thing with locate. Not sure if you can use ls -l simultaneously, my memory says 'no'.
10 months, 1 week ago by BigEclipse
So yeah
find . -name file.ext -exec ls -l {} \;
works a treat
:)
10 months, 1 week ago by alexleonard
@edythemighty: That article you linked to had it right, but for some reason it wasn't working for me unless su'd
Thanks for the help people :)
10 months, 1 week ago by alexleonard