Re: [SLUG] list files with certain permissions

From: Eben King (eben1@tampabay.rr.com)
Date: Mon Jul 04 2005 - 17:40:14 EDT


On Sat, 2 Jul 2005, Chuck Hast wrote:

> On 7/2/05, Eben King <eben1@tampabay.rr.com> wrote:
> > On Sat, 2 Jul 2005, Chuck Hast wrote:
> >
> > > Folks, I am trying to sort through a load of files and find some that need the
> > > permissions changed.
> > > Of course I can do a ls -al and see the whole thing, indeed I can dump it
> > > into less and go page by page, but I would like to really see the files that
> > > have the permissions set to 744, there are some that I need to set to 755.
> > >
> > > How can I see only those files with the 744 permissions?
> >
> > Files with 744 are -rwxr--r-- so how about "\ls -l | grep ^-rwxr--r--"?
> > That excludes files with SUID and/or SGID, but I don't know if you meant to.

> I did both of them it took the commands but I got no output, just did
> something and came back to the cmdline.

Huh, works here:

[eben@pc tmp]$ touch testfile
[eben@pc tmp]$ chmod 744 testfile
[eben@pc tmp]$ \ls -l | grep ^-rwxr--r--
-rwxr--r-- 1 eben eben 0 Jul 4 17:34 testfile

Maybe you have something that munges ls's output? The "\" should remove all
aliases. Or maybe "744" isn't actually what you meant? I didn't have any
world-writable files, so I had to create one.

-- 
-eben    ebQenW1@EtaRmpTabYayU.rIr.OcoPm    home.tampabay.rr.com/hactar

Drive nail here > < for new monitor.

----------------------------------------------------------------------- This list is provided as an unmoderated internet service by Networked Knowledge Systems (NKS). Views and opinions expressed in messages posted are those of the author and do not necessarily reflect the official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 17:13:50 EDT