LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-29-2006, 05:56 PM   #1
flipwhy
Member
 
Registered: Jul 2006
Posts: 102

Rep: Reputation: 15
simple question - how to chown ALL files in a dir?


how do you change the owner of al lthe files in a directory in one command...coz its really annoying ot change each file separately...
 
Old 08-29-2006, 06:07 PM   #2
kaz2100
Senior Member
 
Registered: Apr 2005
Location: Penguin land, with apple, no gates
Distribution: Debian testing woody(32) sarge etch lenny squeeze(+64) wheezy jessie stretch
Posts: 1,599

Rep: Reputation: 97
Check "man chown", and look for possible options.
 
Old 08-29-2006, 06:09 PM   #3
zackarya
Member
 
Registered: Jul 2003
Distribution: OpenSuse 10, Debian
Posts: 152

Rep: Reputation: 30
All you need to do is

chown (username) *

and all files in the current directory will be changed to (username) as the owner.

Zackarya
 
Old 08-29-2006, 06:12 PM   #4
flipwhy
Member
 
Registered: Jul 2006
Posts: 102

Original Poster
Rep: Reputation: 15
chown -R is the way forward...cant beleive i asked bout that...o well...thanks
 
Old 08-29-2006, 06:47 PM   #5
kaz2100
Senior Member
 
Registered: Apr 2005
Location: Penguin land, with apple, no gates
Distribution: Debian testing woody(32) sarge etch lenny squeeze(+64) wheezy jessie stretch
Posts: 1,599

Rep: Reputation: 97
 
Old 08-29-2006, 06:54 PM   #6
zackarya
Member
 
Registered: Jul 2003
Distribution: OpenSuse 10, Debian
Posts: 152

Rep: Reputation: 30
With -R you will change all files in the sub directories as well and
not just in the current directory.

Just so you know.

Zackarya
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cron Question - Delete files in a dir older than 48 hours? t3___ Linux - Newbie 5 10-11-2011 04:42 AM
Simple Question - How much space is a dir taking up? elitecodex Linux - Newbie 4 06-22-2005 10:17 AM
Can't chmod/chown a dir after smbmout !? Ramu Linux - Security 2 01-19-2005 10:24 AM
simple bash question -- changing dir towlie Programming 3 05-28-2004 12:55 PM
chown....no such file or dir. Dr.Swing Linux From Scratch 6 10-08-2002 05:42 PM


All times are GMT -5. The time now is 08:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration