LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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, 04: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, 05:07 PM   #2
kaz2100
Senior Member
 
Registered: Apr 2005
Location: Penguin land, with apple, no gates
Distribution: SlackWare > Debian testing woody(32) sarge etch lenny squeeze(+64) wheezy .. bullseye bookworm
Posts: 1,834

Rep: Reputation: 108Reputation: 108
Check "man chown", and look for possible options.
 
Old 08-29-2006, 05: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, 05: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, 05:47 PM   #5
kaz2100
Senior Member
 
Registered: Apr 2005
Location: Penguin land, with apple, no gates
Distribution: SlackWare > Debian testing woody(32) sarge etch lenny squeeze(+64) wheezy .. bullseye bookworm
Posts: 1,834

Rep: Reputation: 108Reputation: 108
 
Old 08-29-2006, 05: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



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 03:42 AM
Simple Question - How much space is a dir taking up? elitecodex Linux - Newbie 4 06-22-2005 09:17 AM
Can't chmod/chown a dir after smbmout !? Ramu Linux - Security 2 01-19-2005 09:24 AM
simple bash question -- changing dir towlie Programming 3 05-28-2004 11:55 AM
chown....no such file or dir. Dr.Swing Linux From Scratch 6 10-08-2002 04:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:52 AM.

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
Open Source Consulting | Domain Registration