Re: find/list read only files

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


Date: Tue, 29 Jun 2004 05:40:25 GMT

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



Relevant Pages

  • Re: Setting permissions in DJGPP.ENV
    ... I was wondering if it's possible to set UNIX-like permissions for ... Mutt (the e-mail client) to check my mail on an SSL-encrypted IMAP ... Since DOS has no such file, you can pass it a "randfile" ...
    (comp.os.msdos.djgpp)
  • Re: Dos connection to SBS2K3 share
    ... 2k3 permissions than Dos. ... On our SBS2003 server I have created a hidden share called images$. ... The ntfs and share permissions are set to allow the 'everyone' group full ...
    (microsoft.public.windows.server.sbs)
  • Setting permissions in DJGPP.ENV
    ... I was wondering if it's possible to set UNIX-like permissions for ... Mutt (the e-mail client) to check my mail on an SSL-encrypted IMAP ... Since DOS has no such file, you can pass it a "randfile" ...
    (comp.os.msdos.djgpp)
  • Re: Granting share access permissions from DOS prompt
    ... I was wondering if anyone knows the DOS command to grant/revoke file ... sharing permissions of a shared folder. ... I'm hoping if this can be done by a DOS batch file or a VBS script, ...
    (microsoft.public.windowsxp.general)
  • Re: DOS based program running in network win 2000
    ... It seems like the program did not start on the DOS ... You didn't mention what privilege or permissions are involved. ... to run the console application over the network, ...
    (microsoft.public.win2000.general)