|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
||||
|
||||
|
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. |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
||||
|
||||
|
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...
|
|
#4
|
||||
|
||||
|
you can do the same thing with chmod.
chmod -R perms directory |
|
#5
|
||||
|
||||
|
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...
|
|
#6
|
|||
|
|||
|
Quote:
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) |
|
#7
|
||||
|
||||
|
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... |
|
#8
|
|||
|
|||
|
Quote:
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 ![]() |
|
#9
|
||||
|
||||
|
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... ![]() |
|
#10
|
|||
|
|||
|
Quote:
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. |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > Linux Help > recursive chown |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|