public inbox for linux-newbie@vger.kernel.org
 help / color / mirror / Atom feed
* Change permissions of files to -xw +r for all other users
@ 2005-05-26 17:44 Rhys Hardwick
  2005-05-26 18:36 ` J.
  2005-06-09 16:11 ` Stephen Samuel
  0 siblings, 2 replies; 8+ messages in thread
From: Rhys Hardwick @ 2005-05-26 17:44 UTC (permalink / raw)
  To: linux-newbie

Hey there,

I know this may be a case of RTM, but I am getting confused on it.

I want to change the permissions of all the files in my home folder to read 
only for all users but myself, but to leave directories executable so that 
they can be opened.  I have had difficulty doing this for only other users, 
and have ended up -xw for myself as well, even tyring many variations of the 
-o tag.  Any help would be fantastic.

-- 
 Rhys Hardwick
 
 -----------------------------------------------------
| rhys@rhyshardwick.co.uk  |  www.rhyshardwick.co.uk  |
| PGP-id - 0x63AB126D      |                          |
|=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|
|       Windows: Just another pain in the glass.      | 
 *****************************************************

		
___________________________________________________________ 
How much free photo storage do you get? Store your holiday 
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Change permissions of files to -xw +r for all other users
  2005-05-26 17:44 Change permissions of files to -xw +r for all other users Rhys Hardwick
@ 2005-05-26 18:36 ` J.
  2005-05-26 19:21   ` Rhys Hardwick
  2005-06-09 16:11 ` Stephen Samuel
  1 sibling, 1 reply; 8+ messages in thread
From: J. @ 2005-05-26 18:36 UTC (permalink / raw)
  To: linux-newbie

On Thu, 26 May 2005, Rhys Hardwick wrote:

> Hey there,
> 
> I know this may be a case of RTM, but I am getting confused on it.
> 
> I want to change the permissions of all the files in my home folder to read 
> only for all users but myself, but to leave directories executable so that 
> they can be opened.  I have had difficulty doing this for only other users, 
> and have ended up -xw for myself as well, even tyring many variations of the 
> -o tag.  Any help would be fantastic.

What program are you talking about ? The program `find` perhaps ? Or using
just `chmod` ?

If you want to find any file in the current directory not owned by you
then:

~: find . -type f ! -user imyselfandi -maxdepth 1

The `!' exclamation mark means NOT .

If you want to change the permission of all files which were found by the
previous command you could tell find to exec chmod with the desired
permissions, for example:

~: find . -type f ! -user imyselfandi -maxdepth 1 -exec chmod 0744 '{}' \;

Or you could use a command line shell filter:

~: find . -type f ! -user imyselfandi -maxdepth 1 | while read FILE ; do
chmod 0744 ${FILE} ; done 

Note; the command is actualy one line, the format breaks because of the
text width in the e-mail message..

Hope this answers your question ...

> -- 
>  Rhys Hardwick

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Change permissions of files to -xw +r for all other users
  2005-05-26 18:36 ` J.
@ 2005-05-26 19:21   ` Rhys Hardwick
  2005-05-26 20:50     ` J.
  2005-05-26 21:00     ` J.
  0 siblings, 2 replies; 8+ messages in thread
From: Rhys Hardwick @ 2005-05-26 19:21 UTC (permalink / raw)
  To: linux-newbie

I was just using chmod.  This helps.  I can use find to only select files, not 
directories, and change the permissions.  However, the real question is how 
to make chmod not alter the permissions for the files owner, but to remove 
write and exectute permissions for group and others.  That is the bit that 
has stumped me.  

Cheers,

Rhys


On Thursday 26 May 2005 19:36, J. wrote:
> On Thu, 26 May 2005, Rhys Hardwick wrote:
> > Hey there,
> >
> > I know this may be a case of RTM, but I am getting confused on it.
> >
> > I want to change the permissions of all the files in my home folder to
> > read only for all users but myself, but to leave directories executable
> > so that they can be opened.  I have had difficulty doing this for only
> > other users, and have ended up -xw for myself as well, even tyring many
> > variations of the -o tag.  Any help would be fantastic.
>
> What program are you talking about ? The program `find` perhaps ? Or using
> just `chmod` ?
>
> If you want to find any file in the current directory not owned by you
> then:
>
> ~: find . -type f ! -user imyselfandi -maxdepth 1
>
> The `!' exclamation mark means NOT .
>
> If you want to change the permission of all files which were found by the
> previous command you could tell find to exec chmod with the desired
> permissions, for example:
>
> ~: find . -type f ! -user imyselfandi -maxdepth 1 -exec chmod 0744 '{}' \;
>
> Or you could use a command line shell filter:
>
> ~: find . -type f ! -user imyselfandi -maxdepth 1 | while read FILE ; do
> chmod 0744 ${FILE} ; done
>
> Note; the command is actualy one line, the format breaks because of the
> text width in the e-mail message..
>
> Hope this answers your question ...
>
> > --
> >  Rhys Hardwick
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.linux-learn.org/faqs

-- 
 Rhys Hardwick
 
 -----------------------------------------------------
| rhys@rhyshardwick.co.uk  |  www.rhyshardwick.co.uk  |
| PGP-id - 0x63AB126D      |                          |
|=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|
|       Windows: Just another pain in the glass.      | 
 *****************************************************

	
	
		
___________________________________________________________ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Change permissions of files to -xw +r for all other users
  2005-05-26 19:21   ` Rhys Hardwick
@ 2005-05-26 20:50     ` J.
  2005-05-27 17:17       ` Rhys Hardwick
  2005-05-26 21:00     ` J.
  1 sibling, 1 reply; 8+ messages in thread
From: J. @ 2005-05-26 20:50 UTC (permalink / raw)
  To: linux-newbie

On Thu, 26 May 2005, Rhys Hardwick wrote:

> I was just using chmod.  This helps.  I can use find to only select files, not 
> directories, and change the permissions.  However, the real question is how 
> to make chmod not alter the permissions for the files owner, but to remove 
> write and exectute permissions for group and others.  That is the bit that 
> has stumped me.  

Use a `0' a.k.a. zero with `chmod` in the last position

If I would use the command  `ls -l` on an arbitrary file in my directory:
-rw-rw-r--    1 jason   donovan        201 Apr 23 04:14 todo.txt 

Now you can see that the user `jason' has [r]ead[w]rite permissions the
same goes for the group named `donovan' and all other users have only
[r]ead permissions .

chmod 0660 todo.txt

-rw-rw----    1 jason   donovan        201 Apr 23 04:14 todo.txt

Now the permissions for jason and donovan stayed the same; except for all
other users [the world] which have no permissions.

Hope that helped...

J.

> Cheers,
> 
> Rhys

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Change permissions of files to -xw +r for all other users
  2005-05-26 19:21   ` Rhys Hardwick
  2005-05-26 20:50     ` J.
@ 2005-05-26 21:00     ` J.
  1 sibling, 0 replies; 8+ messages in thread
From: J. @ 2005-05-26 21:00 UTC (permalink / raw)
  To: linux-newbie

On Thu, 26 May 2005, Rhys Hardwick wrote:

> I was just using chmod.  This helps.  I can use find to only select files, not 
> directories, and change the permissions.  However, the real question is how 
> to make chmod not alter the permissions for the files owner, but to remove 
> write and exectute permissions for group and others.  


> That is the bit that has stumped me.  

Ok, I was just reading your message again.. and I got it this time, You
are mixing up symbolic mode with the octal mode.. oeff.. Sorry.. I'ts late
here already..  ;-)

the command:
~: chmod o-rwx todo.txt

Will remove rwx from the third field e.g. others or `the world' . The `-'
hyphen does not signal an option but stands for remove, instead of the
hyphen `-' you could als use the plus `+' sign to add rights.
The first character in this case is the `o' of others.. you could also use
the u etc.. that's explained in the manual page..

~: chmod u-rwx todo.txt

J.

> Cheers,
> 
> Rhys
> 
> 
> On Thursday 26 May 2005 19:36, J. wrote:
> > On Thu, 26 May 2005, Rhys Hardwick wrote:
> > > Hey there,
> > >
> > > I know this may be a case of RTM, but I am getting confused on it.
> > >
> > > I want to change the permissions of all the files in my home folder to
> > > read only for all users but myself, but to leave directories executable
> > > so that they can be opened.  I have had difficulty doing this for only
> > > other users, and have ended up -xw for myself as well, even tyring many
> > > variations of the -o tag.  Any help would be fantastic.
> >
> > What program are you talking about ? The program `find` perhaps ? Or using
> > just `chmod` ?
> >
> > If you want to find any file in the current directory not owned by you
> > then:
> >
> > ~: find . -type f ! -user imyselfandi -maxdepth 1
> >
> > The `!' exclamation mark means NOT .
> >
> > If you want to change the permission of all files which were found by the
> > previous command you could tell find to exec chmod with the desired
> > permissions, for example:
> >
> > ~: find . -type f ! -user imyselfandi -maxdepth 1 -exec chmod 0744 '{}' \;
> >
> > Or you could use a command line shell filter:
> >
> > ~: find . -type f ! -user imyselfandi -maxdepth 1 | while read FILE ; do
> > chmod 0744 ${FILE} ; done
> >
> > Note; the command is actualy one line, the format breaks because of the
> > text width in the e-mail message..
> >
> > Hope this answers your question ...
> >
> > > --
> > >  Rhys Hardwick
> >
> > -
> > To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at http://www.linux-learn.org/faqs
> 
> -- 
>  Rhys Hardwick
>  
>  -----------------------------------------------------
> | rhys@rhyshardwick.co.uk  |  www.rhyshardwick.co.uk  |
> | PGP-id - 0x63AB126D      |                          |
> |=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|
> |       Windows: Just another pain in the glass.      | 
>  *****************************************************
> 
> 	
> 	
> 		
> ___________________________________________________________ 
> Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com
> -
> To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.linux-learn.org/faqs
> 

Thursday, May 26 22:56:06



-- 
Don't worry Ma'am. We're university students, - we know what we're doing.

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Change permissions of files to -xw +r for all other users
  2005-05-26 20:50     ` J.
@ 2005-05-27 17:17       ` Rhys Hardwick
  0 siblings, 0 replies; 8+ messages in thread
From: Rhys Hardwick @ 2005-05-27 17:17 UTC (permalink / raw)
  To: linux-newbie

> Hope that helped...
>
> J.
>

Gotcha, thanks for the help.  I did figure out that bit, it was the part about 
only selecting files, so when I -x 'd them, I wouldn't take list privileges 
away from the directories.  

Thanks,

Rhys

	
	
		
___________________________________________________________ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Change permissions of files to -xw +r for all other users
  2005-05-26 17:44 Change permissions of files to -xw +r for all other users Rhys Hardwick
  2005-05-26 18:36 ` J.
@ 2005-06-09 16:11 ` Stephen Samuel
  2005-07-13 11:52   ` oops " Stephen Samuel
  1 sibling, 1 reply; 8+ messages in thread
From: Stephen Samuel @ 2005-06-09 16:11 UTC (permalink / raw)
  To: rhys; +Cc: linux-newbie

Rhys Hardwick wrote:

>Hey there,
>
>I know this may be a case of RTM, but I am getting confused on it.
>
>I want to change the permissions of all the files in my home folder to read 
>only for all users but myself, but to leave directories executable so that 
>they can be opened.  I have had difficulty doing this for only other users, 
>and have ended up -xw for myself as well, even tyring many variations of the 
>-o tag.  Any help would be fantastic.
>  
>
What it sounds like you want to do is set permissions to read-only for 
others and group.

The proper command would be:

find ~ -type f -print0 | xargs -0 chmod og=r 

The '0' causes each filename to be terminated with a null  ('\0') rather 
than a
newline (which is actually legal in a filename)
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 8+ messages in thread

* oops Re: Change permissions of files to -xw +r for all other users
  2005-06-09 16:11 ` Stephen Samuel
@ 2005-07-13 11:52   ` Stephen Samuel
  0 siblings, 0 replies; 8+ messages in thread
From: Stephen Samuel @ 2005-07-13 11:52 UTC (permalink / raw)
  To: Stephen Samuel, rhys, linux-newbie

Stephen Samuel wrote:
> Rhys Hardwick wrote:
> 
>> Hey there,
>>
>> I know this may be a case of RTM, but I am getting confused on it.
>>
>> I want to change the permissions of all the files in my home folder to 
>> read only for all users but myself, but to leave directories 
>> executable so that they can be opened.  I have had difficulty doing 
>> this for only other users, and have ended up -xw for myself as well, 
>> even tyring many variations of the -o tag.  Any help would be fantastic.


> find ~ -type f -print0 | xargs -0 chmod og=r

On second thought:
Presuming that you really just want to remove write access, I'd
try  'chmod og-w' or 'chmod og-wx'

That would remove the write bit or the write and execute bits,
but not add the read bit.  There tend to be some files in a users
directory that you don't want readable all (like ssh private keys,
cert files etc.)

-- 
Stephen Samuel +1(604)876-0426                samuel@bcgreen.com
		   http://www.bcgreen.com/~samuel/
    Powerful committed communication. Transformation touching
      the jewel within each person and bringing it to light.
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-07-13 11:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-26 17:44 Change permissions of files to -xw +r for all other users Rhys Hardwick
2005-05-26 18:36 ` J.
2005-05-26 19:21   ` Rhys Hardwick
2005-05-26 20:50     ` J.
2005-05-27 17:17       ` Rhys Hardwick
2005-05-26 21:00     ` J.
2005-06-09 16:11 ` Stephen Samuel
2005-07-13 11:52   ` oops " Stephen Samuel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox