Mailinglist Archive: opensuse (3539 mails)
| < Previous | Next > |
Re: [opensuse] Script problem
- From: Erwin Lam <erwinlam@xxxxxx>
- Date: Sun, 15 Jun 2008 01:25:43 +0200
- Message-id: <200806150125.45332.erwinlam@xxxxxx>
On Saturday 14 June 2008 23:12:05 Rodney Baker wrote:
I think the following commands will do:
find . -type f -exec chmod 644 \{\} \;
find . -type d -exec chmod 755 \{\} \;
No need to use xargs. Also note the use of "." to indicate the current
directory, which the previous poster forgot.
--
Erwin Lam (erwinlam@xxxxxx)
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx
On Sun, 15 Jun 2008 05:45:58 Rikard Johnels wrote:
Hello all!
I am (unsuccessfully) trying to arrange the usermod and permissions
on some 5.000 folders and 20.000 files. (My music collection)
I cant for my life compose a script that:
a. Will set all directories to chmod 755
b, will set all regular files to perm 644
To change all the subdirectories of the current working directory:
find -type d -print0 | xargs -0 chmod 0755
This will find all directories under the current directory and set
their perms to 0755.
Similarly with the files:
find -type f -print0 | xargs -0 chmod 0644.
I think the following commands will do:
find . -type f -exec chmod 644 \{\} \;
find . -type d -exec chmod 755 \{\} \;
No need to use xargs. Also note the use of "." to indicate the current
directory, which the previous poster forgot.
--
Erwin Lam (erwinlam@xxxxxx)
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx
| < Previous | Next > |