TechTalkz.com Logo Ask the Experts!

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Linux & Opensource > Debian Linux

How to change owner and group of files.

Debian Linux

 
 
Thread Tools Display Modes
Unread 22-11-2007, 09:02 AM   #1
Henk Oegema
Guest
 
Posts: n/a
How to change owner and group of files.

I have a directory ~/.kde/share/apps/kmail/mail/cur with hunderds of files
(e-mails) of which I want to switch owner and group from root root to
henkoegema henkoegema

How can I do that in one command ?

Rgds
Henk
 
Unread 22-11-2007, 09:02 AM   #2
Noozer
Guest
 
Posts: n/a
Re: How to change owner and group of files.


"Henk Oegema" <henk@oegema.com> wrote in message
news:RPa1j.219260$gM5.12435682@phobos.telenet-ops.be...
>I have a directory ~/.kde/share/apps/kmail/mail/cur with hunderds of files
> (e-mails) of which I want to switch owner and group from root root to
> henkoegema henkoegema
>
> How can I do that in one command ?


chown henkoegema ~/.kde/share/apps/kmail/mail/cur/* ; chgrp henkoegema
~/.kde/share/apps/kmail/mail/cur/*


Add a -R after the command to recurse into sub directories.


 
Unread 22-11-2007, 09:58 AM   #3
Henk Oegema
Guest
 
Posts: n/a
Re: How to change owner and group of files.

Noozer wrote:

>
> "Henk Oegema" <henk@oegema.com> wrote in message
> news:RPa1j.219260$gM5.12435682@phobos.telenet-ops.be...
>>I have a directory ~/.kde/share/apps/kmail/mail/cur with hunderds of files
>> (e-mails) of which I want to switch owner and group from root root to
>> henkoegema henkoegema
>>
>> How can I do that in one command ?

>
> chown henkoegema ~/.kde/share/apps/kmail/mail/cur/* ; chgrp henkoegema
> ~/.kde/share/apps/kmail/mail/cur/*
>
>
> Add a -R after the command to recurse into sub directories.


Thanks. Specific the -R option was, what I needed.

 
Unread 22-11-2007, 01:58 PM   #4
Lew Pitcher
Guest
 
Posts: n/a
Re: How to change owner and group of files.

On Nov 22, 3:10 am, Henk Oegema <h...@oegema.com> wrote:
> I have a directory ~/.kde/share/apps/kmail/mail/cur with hunderds of files
> (e-mails) of which I want to switch owner and group from root root to
> henkoegema henkoegema
>
> How can I do that in one command ?



chown -R henkoegema:henkoegema ~/.kde/share/apps/kmail/mail/cur/*
 
Unread 22-11-2007, 02:59 PM   #5
Henk Oegema
Guest
 
Posts: n/a
Re: How to change owner and group of files.

Lew Pitcher wrote:

> On Nov 22, 3:10 am, Henk Oegema <h...@oegema.com> wrote:
>> I have a directory ~/.kde/share/apps/kmail/mail/cur with hunderds of
>> files (e-mails) of which I want to switch owner and group from root root
>> to henkoegema henkoegema
>>
>> How can I do that in one command ?

>
>
> chown -R henkoegema:henkoegema ~/.kde/share/apps/kmail/mail/cur/*


Is the henkoegema:henkoegema for owner and group at the same time?

 
Unread 22-11-2007, 03:59 PM   #6
AHinMaine
Guest
 
Posts: n/a
Re: How to change owner and group of files.

>
> chown -R henkoegema:henkoegema ~/.kde/share/apps/kmail/mail/cur/*



Note that this will not work on filenames that begin with a dot.

A better way...

find ~/.kde/share/apps/kmail/mail/cur | xargs chown
henkoegema:henkoegema
 
Unread 22-11-2007, 04:59 PM   #7
Lew Pitcher
Guest
 
Posts: n/a
Re: How to change owner and group of files.

On Nov 22, 9:16 am, Henk Oegema <h...@oegema.com> wrote:
> Lew Pitcher wrote:
> > On Nov 22, 3:10 am, Henk Oegema <h...@oegema.com> wrote:
> >> I have a directory ~/.kde/share/apps/kmail/mail/cur with hunderds of
> >> files (e-mails) of which I want to switch owner and group from root root
> >> to henkoegema henkoegema

>
> >> How can I do that in one command ?

>
> > chown -R henkoegema:henkoegema ~/.kde/share/apps/kmail/mail/cur/*

>
> Is the henkoegema:henkoegema for owner and group at the same time?


Yes...

CHOWN(1) User Commands
CHOWN(1)

NAME
chown - change file owner and group

SYNOPSIS
chown [OPTION]... [OWNER][:[GROUP]] FILE...
 
Unread 22-11-2007, 04:59 PM   #8
Tony van der Hoff
Guest
 
Posts: n/a
Re: How to change owner and group of files.

On 22 Nov at 16:01 Lew Pitcher <lpitcher@teksavvy.com> wrote in message
<e825bd41-eb97-428c-9bbd-257ee3fdfd2b@e1g2000hsh.googlegroups.com>

> On Nov 22, 9:16 am, Henk Oegema <h...@oegema.com> wrote:
> > Lew Pitcher wrote:
> > > On Nov 22, 3:10 am, Henk Oegema <h...@oegema.com> wrote:
> > > > I have a directory ~/.kde/share/apps/kmail/mail/cur with hunderds of
> > > > files (e-mails) of which I want to switch owner and group from root
> > > > root to henkoegema henkoegema

> >
> > > > How can I do that in one command ?

> >
> > > chown -R henkoegema:henkoegema ~/.kde/share/apps/kmail/mail/cur/*

> >
> > Is the henkoegema:henkoegema for owner and group at the same time?

>
> Yes...
>
> CHOWN(1) User Commands CHOWN(1)
>
> NAME
> chown - change file owner and group
>
> SYNOPSIS
> chown [OPTION]... [OWNER][:[GROUP]] FILE...
>


Actually, being really pedantic, you only need
chown -R henkoegema: ~/.kde/share/apps/kmail/mail/cur/*
--
Tony van der Hoff | mailto:news_0711@vanderhoff.org
Buckinghamshire, England
 
Unread 22-11-2007, 04:59 PM   #9
Dan C
Guest
 
Posts: n/a
Re: How to change owner and group of files.

On Thu, 22 Nov 2007 09:20:58 +0000, Henk Oegema wrote:

>> Add a -R after the command to recurse into sub directories.


> Thanks. Specific the -R option was, what I needed.


I guess you've never heard of a "man page", eh?


--
"Ubuntu" -- an African word, meaning "Slackware is too hard for me".

 
Unread 23-11-2007, 07:58 AM   #10
Fredderic
Guest
 
Posts: n/a
Re: How to change owner and group of files.

On Thu, 22 Nov 2007 16:43:33 +0000,
Tony van der Hoff <news@nospam.vanderhoff.org> wrote:

> On 22 Nov at 16:01 Lew Pitcher <lpitcher@teksavvy.com> wrote
> > On Nov 22, 9:16 am, Henk Oegema <h...@oegema.com> wrote:
> > > Lew Pitcher wrote:
> > > > On Nov 22, 3:10 am, Henk Oegema <h...@oegema.com> wrote:
> > > > > I have a directory ~/.kde/share/apps/kmail/mail/cur with
> > > > > hunderds of files (e-mails) of which I want to switch owner
> > > > > and group from root root to henkoegema henkoegema
> > > > > How can I do that in one command ?
> > > > chown -R henkoegema:henkoegema
> > > > ~/.kde/share/apps/kmail/mail/cur/*
> > > Is the henkoegema:henkoegema for owner and group at the same time?

> > Yes...
> > chown - change file owner and group
> > chown [OPTION]... [OWNER][:[GROUP]] FILE...

> Actually, being really pedantic, you only need
> chown -R henkoegema: ~/.kde/share/apps/kmail/mail/cur/*


You're assuming, of course, that the default group is also
henkoegema... Here, for example, my default group is "users", but I'm
also in a group with my username. I changed the default myself because
it's actually useful, as long as you're aware of what groups do.


Also being pedantic.


Fredderic
 
 

Thread Tools
Display Modes



< Home - Windows Help - MS Office Help - Hardware Support >


New To Site? Need Help?

All times are GMT. The time now is 10:19 AM.


vBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2013, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional