Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

finding files by permission 1

Status
Not open for further replies.
Jan 26, 2004
18
US
I would love to be able to find certain files within a given directory that have a specific permision set.

I tired this....but I failed (hence my post)
ls -l | grep -rw-------

Im sure it has something to do with special characters (-)

Does anyone have any advice for me?

 
Sounds like a job for the ever flexible find command.

But first, a note on permissions.
[tt]r=4
w=2
x=1[/tt]
Many programs code permissions using these values, so
[tt]-rw-------[/tt]
would be
[tt]600[/tt]

The find command can be used to find files with these permissions.
[tt]find . -perm 600 -ls[/tt]

--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top