Re: find/list read only files

From: Alan Connor (zzzzzz_at_xxx.yyy)
Date: 06/29/04


Date: Tue, 29 Jun 2004 09:45:18 GMT

On Tue, 29 Jun 2004 05:40:25 GMT, Alan Connor <zzzzzz@xxx.yyy> wrote:
>
>
> On 28 Jun 2004 21:03:30 -0700, Tron Thomas <tron.thomas@verizon.net> wrote:
>>
>>
>> In DOS a person can type:
>>
>> dir /ar
>>
>> and it will display all the files in the current directory that has a
>> read only attribute.
>>
>> What is an eqivalent UNIX command that will accomplish the same task?
>
> Unix/Linux permissions are a bit more complex than DOS permissions.
>
> It's simpler if you are looking for files with specific permissions.
>
> find . -type f -perm 440 -maxdepth 1 -print
>
> would find all of the regular files in your current directory with
> -r--r----- permissions, which is to say that user and group had
> only read permissions and other had no permissions.
>
>
> ls -l | grep '^-r--r-----'
>
> would accomplish the same thing.
>
> (drop the "-maxdepth 1" if you want it to search through all of
> the sub-directories too)
>
> If you wanted to find every file with read-only permissions of every
> possible combination, the script gets quite a bit longer.
>
> man find, man chmod, man grep
>
> This is one of the reasons that Unix/Linux are so much more secure
> than DOS/Windoze. It's a tradeoff...
>
>
> AC
>

Correction!

find . -type f ! -perm +ugo+wx -maxdepth 1 -print

will find all the files with no write or execute permissions,
which is pretty close to read-only, if not there.

You could alias that to something like "lr" to make it easy to
use again. What shell do you have?

AC



Relevant Pages

  • Re: Files and Folder Permissions
    ... Without knowing exactly what you are trying to accomplish all I can say is - try the various settings until you get the combination that works for you. ... You may want to play with a test folder until you figure out what works. ... Finally would I need to select the Replace permissions entries on all child ... If the users are running programs like Office that create temp files ...
    (microsoft.public.windows.server.general)
  • Exch07/OL07: Change Calendar Permission for All Users, Free/Busy T
    ... We have been given a task which we are not quite sure how to accomplish. ... I think what needs to change is the Default permissions on the Calendar from ... Default = Free/Busy Time to Default = None. ... to manually set permissions in Outlook on each user’s Calendar permissions to ...
    (microsoft.public.exchange.admin)
  • Re: Secure updates.
    ... modifiy the ACL to accomplish the restriction you seem ... interested in verifying. ... on the records it has defined, which same permissions are not ... "mike" wrote in message ...
    (microsoft.public.windows.server.dns)
  • run .exe from web service - looking for ideas
    ... Here is what I am trying to accomplish. ... I had thought to use a web service to accomplish this, ... Public Overloads Function Encrypt(ByVal a_strEncryptKey As String, ... and I'm sure other permissions settings. ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: find/list read only files
    ... > What is an eqivalent UNIX command that will accomplish the same task? ... Unix/Linux permissions are a bit more complex than DOS permissions. ...
    (comp.unix.shell)