Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 May 1996 08:28:13 +0200 (GMT)
From:      Robin Lunn <robin@is.co.za>
To:        garth@dogbert.systems.sa.gov.au (Garth Kidd)
Cc:        questions@freefall.freebsd.org
Subject:   Re: running gag: chmod -R .\*
Message-ID:  <199605100628.IAA02818@admin.is.co.za>
In-Reply-To: <960510143531.ZM2871@jolt.systems.sa.gov.au> from "Garth Kidd" at May 10, 96 02:16:23 pm

next in thread | previous in thread | raw e-mail | index | archive | help
Garth Kidd wrote:
> > Unless the argument list is too long.  :-(
> > 
> > 	ls -A | xargs chmod 0644 -R

ls -A shows directory names with a : before listing the files.

> Aah, but what about .files in subdirectories?
> 
>   #!/bin/csh
>   foreach a (`find . -type d -print`)
>     cd $a
>     chmod 0644 `/bin/ls -1Ad`
>   end
> 
> Note that find won't follow symlinked directories, which is probably a good 
> thing.

find . -type f -exec chmod 0644 {} \;

This finds all files and ignores directories like .. and such.  It doesn't
depend on any shell either.
-- 
_ __                  | Only my ideas here unless I say otherwise...
' )  )     /          | (BeamJack@IRC)                 
 /--' ____/___o  __   | "Nondum amabam, et amare amabam...  quaerebam
/  \_(_) /_) (__/) )_ |  quid amarem, amans amare." - St Augustine



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199605100628.IAA02818>