FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 02-16-2008, 03:22 PM
Brian Marshall
 
Default How to change permission on this

On Sat, 16 Feb 2008 17:03:28 +0100
"Amar Cosic" <amar.cosic@gmail.com> wrote:

> I have a lot of dir. and files in my home directory. I want to chown
> all of it to my user. How to do this by one comand ? Thanks
>
>
>
With recursion:
chown -R user:group *


Brian
 
Old 02-16-2008, 03:26 PM
Willie Wong
 
Default How to change permission on this

On Sat, Feb 16, 2008 at 05:03:28PM +0100, Penguin Lover Amar Cosic squawked:
> I have a lot of dir. and files in my home directory. I want to chown all of
> it to my user. How to do this by one comand ? Thanks

sudo chown -R <your user> <the root directory of all the files>

the -R option makes it recursive. no need to sudo if you are root
already.

W
--
"Another world, another day, another dawn. "
Sortir en Pantoufles: up 435 days, 14:55
--
gentoo-user@lists.gentoo.org mailing list
 
Old 02-16-2008, 03:29 PM
Neil Bothwick
 
Default How to change permission on this

On Sat, 16 Feb 2008 08:22:19 -0800, Brian Marshall wrote:

> > I have a lot of dir. and files in my home directory. I want to chown
> > all of it to my user. How to do this by one comand ? Thanks

> With recursion:
> chown -R user:group *

That won't cover hidden files, try

chown -R user: ~user


--
Neil Bothwick

Death is proven to be 99.9% fatal to all laboratory rats.
 
Old 02-16-2008, 03:30 PM
"Anno v. Heimburg"
 
Default How to change permission on this

Amar Cosic wrote:

> I have a lot of dir. and files in my home directory. I want to chown all
> of it to my user. How to do this by one comand ? Thanks

Hm. Is an answer of "RTFM" accepted on this mailing list?

man chown. Specifically, take a long hard look at the -R option.



--
gentoo-user@lists.gentoo.org mailing list
 
Old 02-16-2008, 03:31 PM
"Amar Cosic"
 
Default How to change permission on this

Thanks guys.. that worked

On Feb 16, 2008 5:26 PM, Willie Wong <wwong@princeton.edu> wrote:

On Sat, Feb 16, 2008 at 05:03:28PM +0100, Penguin Lover Amar Cosic squawked:
> I have a lot of dir. and files in my home directory. I want to chown all of
> it to my user. How to do this by one comand ? Thanks


sudo chown -R <your user> <the root directory of all the files>

the -R option makes it recursive. no need to sudo if you are root
already.

W
--
"Another world, another day, another dawn. "

Sortir en Pantoufles: up 435 days, 14:55
--
gentoo-user@lists.gentoo.org mailing list




--
Amar Ćosić
amar.cosic@gmail.com
amar@amar.co.ba
+38761240095
http://www.amar.co.ba
 
Old 02-16-2008, 03:36 PM
Etaoin Shrdlu
 
Default How to change permission on this

On Saturday 16 February 2008, Amar Cosic wrote:

> I have a lot of dir. and files in my home directory. I want to chown
> all of it to my user. How to do this by one comand ? Thanks

man chown, option -R
--
gentoo-user@lists.gentoo.org mailing list
 
Old 02-16-2008, 03:50 PM
Dale
 
Default How to change permission on this

Neil Bothwick wrote:

On Sat, 16 Feb 2008 08:22:19 -0800, Brian Marshall wrote:



I have a lot of dir. and files in my home directory. I want to chown
all of it to my user. How to do this by one comand ? Thanks





With recursion:
chown -R user:group *



That won't cover hidden files, try

chown -R user: ~user





Neil,

What does the "~" make it do different? Got me curious about that.

Dale

:-) :-)
--
gentoo-user@lists.gentoo.org mailing list
 
Old 02-16-2008, 05:29 PM
Uwe Thiem
 
Default How to change permission on this

On Saturday 16 February 2008, Dale wrote:
> Neil Bothwick wrote:
> > On Sat, 16 Feb 2008 08:22:19 -0800, Brian Marshall wrote:
> >>> I have a lot of dir. and files in my home directory. I want to
> >>> chown all of it to my user. How to do this by one comand ?
> >>> Thanks
> >>
> >> With recursion:
> >> chown -R user:group *
> >
> > That won't cover hidden files, try
> >
> > chown -R user: ~user
>
> Neil,
>
> What does the "~" make it do different? Got me curious about that.

Change user only for those files that have a different one. Avoids
unnecessary writes.

Uwe

--
Informal Linux Group Namibia:
http://www.linux.org.na/
SysEx (Pty) Ltd.:
http://www.SysEx.com.na/
--
gentoo-user@lists.gentoo.org mailing list
 
Old 02-16-2008, 07:46 PM
Benno Schulenberg
 
Default How to change permission on this

Uwe Thiem wrote:
> On Saturday 16 February 2008, Dale wrote:
> > Neil Bothwick wrote:
> > > chown -R user: ~user
> >
> > What does the "~" make it do different?
>
> Change user only for those files that have a different one.

No. The ~ prefixed to a user name means the home dir of that user
as it is listed in /etc/passwd.

Benno
--
gentoo-user@lists.gentoo.org mailing list
 
Old 02-16-2008, 11:52 PM
Neil Bothwick
 
Default How to change permission on this

On Sat, 16 Feb 2008 10:50:37 -0600, Dale wrote:

> >> With recursion:
> >> chown -R user:group *

> > That won't cover hidden files, try
> >
> > chown -R user: ~user

> What does the "~" make it do different? Got me curious about that.

Nothing in itself, it just refers to the user's home directory. The
important point is that giving a directory matces all files in that
directory, whereas * omits those beginning with a . in most people's
shells.


--
Neil Bothwick

Strangely enough, Data finds himself relating to Heavy Metal.
 

Thread Tools




All times are GMT. The time now is 03:10 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org