SunQuest
           Linux Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsLinux Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old December 24th, 2002, 03:59 AM
Benahimvp's Avatar
Benahimvp Benahimvp is offline
The Basketball Star
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2001
Location: H-Town
Posts: 550 Benahimvp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via AIM to Benahimvp Send a message via Yahoo to Benahimvp
recursive chown

I'm basically a Linux/UNIX newbie even though i do know a few commands here and there. I have both root and regular user access to a Linux box that's housing my website. Instead of uploading and editing files under my regular user name, I've been uploading under root. I'm really only supposed to be using root to modify stuff outside my web directory (which is outside the realm of my user access) like MySQL & Apache settings. So I'm really not supposed to be using root. Anyway, I want to change all the files in my web directory to my username instead of root. The only problem is that I don't even know how to use chown to change one file, let alone change all the files within my web directory (subdirectories included). I tried "chown --help" but it was still confusing. All the brackets and stuff confuse me were it's of little help. I'm going to search the web for information on chown, but I'm thinking what I'm asking for is a little more complex so I was hoping to get an answer here. I basically want all the files in the web folder and it's subdirectories to be changed to owner "benmvp" and group "web".

Thanks for the help.
__________________
-Ben Ilegbodu
(Around the Bend Web Designs)

Reply With Quote
  #2  
Old December 24th, 2002, 07:40 AM
damonbrinkley damonbrinkley is offline
Modz
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Location: NC, USA
Posts: 364 damonbrinkley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 m 18 sec
Reputation Power: 6
Send a message via AIM to damonbrinkley
man chown will give you all the information you need to use chown.

chown -R user:group directory is what you need to use to change the owner of the directory so that user and group own the directory and it changes the ownership recursively throughout the directory.

Reply With Quote
  #3  
Old December 24th, 2002, 01:02 PM
Benahimvp's Avatar
Benahimvp Benahimvp is offline
The Basketball Star
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2001
Location: H-Town
Posts: 550 Benahimvp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via AIM to Benahimvp Send a message via Yahoo to Benahimvp
Okay, thanks. I didn't realize it was that simple. I guess chown is a lot easier to use than chmod. When I wanted to chmod all the files in a directory it took a complicated set of commands. Oh well. Thanks for the help...

Reply With Quote
  #4  
Old December 24th, 2002, 02:18 PM
kicken's Avatar
kicken kicken is offline
Wiser? Not exactly.
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: May 2001
Location: Ft Myers, FL
Posts: 4,097 kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 115670 Folding Title: Super Ultimate Folder - Level 1Folding Points: 115670 Folding Title: Super Ultimate Folder - Level 1Folding Points: 115670 Folding Title: Super Ultimate Folder - Level 1Folding Points: 115670 Folding Title: Super Ultimate Folder - Level 1Folding Points: 115670 Folding Title: Super Ultimate Folder - Level 1Folding Points: 115670 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 1 Month 2 Weeks 5 Days 22 h 24 m 26 sec
Reputation Power: 532
Send a message via ICQ to kicken Send a message via AIM to kicken Send a message via MSN to kicken
you can do the same thing with chmod.

chmod -R perms directory

Reply With Quote
  #5  
Old December 24th, 2002, 06:57 PM
Benahimvp's Avatar
Benahimvp Benahimvp is offline
The Basketball Star
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2001
Location: H-Town
Posts: 550 Benahimvp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via AIM to Benahimvp Send a message via Yahoo to Benahimvp
Maybe that was the problem. Instead of doing the directory I was trying to do it while inside the directory. But I also wanted to do only the .pl (Perl) files...

Reply With Quote
  #6  
Old December 25th, 2002, 03:01 AM
Strike Strike is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Location: Houston, TX
Posts: 383 Strike User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 41 m 27 sec
Reputation Power: 7
Send a message via ICQ to Strike Send a message via AIM to Strike Send a message via Yahoo to Strike
Quote:
Originally posted by Benahimvp
Maybe that was the problem. Instead of doing the directory I was trying to do it while inside the directory. But I also wanted to do only the .pl (Perl) files...

Assuming you want to recurse through the current directory and its subdirectories, you could use something like:

find . -name \*.pl | xargs chmod 0755

(The \ is in front of the * so that the shell doesn't expand *.pl to a list of the files ending in .pl in the current directory)
__________________
Debian - because life's too short for worrying.
Best. (Python.) IRC bot. ever.

Reply With Quote
  #7  
Old December 25th, 2002, 10:35 AM
Benahimvp's Avatar
Benahimvp Benahimvp is offline
The Basketball Star
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2001
Location: H-Town
Posts: 550 Benahimvp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via AIM to Benahimvp Send a message via Yahoo to Benahimvp
Thanks. That's what I was given before. I guess if I learned what xargs was maybe I'd understand and remember it.

Hey Strike, where in H-town are you from? I live on the Southwest side...

Reply With Quote
  #8  
Old December 25th, 2002, 11:19 PM
Strike Strike is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Location: Houston, TX
Posts: 383 Strike User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 41 m 27 sec
Reputation Power: 7
Send a message via ICQ to Strike Send a message via AIM to Strike Send a message via Yahoo to Strike
Quote:
Originally posted by Benahimvp
Thanks. That's what I was given before. I guess if I learned what xargs was maybe I'd understand and remember it.

Hey Strike, where in H-town are you from? I live on the Southwest side...

Southwest side as well Sort of near Stafford and the Meadows.

And as for xargs, basically what it does is takes a list of stuff on STDIN and performs whatever command you specify to each thing in that list. In this case, that list is a list of filenames and the command is chmod. Alternately you could use the -exec flag for find, but I don't know how to use it very well

Reply With Quote
  #9  
Old December 26th, 2002, 03:20 PM
Benahimvp's Avatar
Benahimvp Benahimvp is offline
The Basketball Star
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2001
Location: H-Town
Posts: 550 Benahimvp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via AIM to Benahimvp Send a message via Yahoo to Benahimvp
Okay cool thanks. I bought a "Learn UNIX in 24 hours books" to learn some of the UNIX commands and I guess I haven't come across that one yet. Learnin UNIX is like learning a whole new language.

I live right around Welch Middle School and Westbury High School...

Reply With Quote
  #10  
Old December 26th, 2002, 04:04 PM
Strike Strike is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Location: Houston, TX
Posts: 383 Strike User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 41 m 27 sec
Reputation Power: 7
Send a message via ICQ to Strike Send a message via AIM to Strike Send a message via Yahoo to Strike
Quote:
Originally posted by Benahimvp
Okay cool thanks. I bought a "Learn UNIX in 24 hours books" to learn some of the UNIX commands and I guess I haven't come across that one yet. Learnin UNIX is like learning a whole new language.

I live right around Welch Middle School and Westbury High School...

Sweet, I love Big UNIX Books(TM) for reference. Mine was a godsend when I was starting out with Linux (mine was "Red Hat Linux 6.0 Unleashed" - a Christmas gift 3 years ago). 1100+ pages of Linux-y goodness.

And, hey, I was zoned to both of those schools (but went to neither). My neighborhood practically butts up to Welch, actually (Glenshire).

[edit]
Heh, apparently "the 'a' word" (I had "Big-***" instead of just "Big" in the first paragraph) doesn't get past the filters
[/edit]

[edit2]
If you want to reminisce on Houston geography, and our locations relative to it, we can use PMs rather than hijack the thread
[/edit2]

Last edited by Strike : December 26th, 2002 at 04:09 PM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsLinux Help > recursive chown


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway