LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 01-19-2003, 04:46 PM   #1
illtbagu
Member
 
Registered: Dec 2002
Location: Nevada
Distribution: fedora, RHEL, ubuntu, suse
Posts: 343

Rep: Reputation: 30
Question chown -R $USER /usr/src/redhat


changed ownership this dir to user by running # chown -R $USER /usr/src/redhat as required for installing microsoft fonts. how can i change it back its original settings. i tried chown -R $root /usr/src/red hat but that didn't work. does anyone have any good links that explain what this command and related commands do.

thanks,
AD
 
Old 01-19-2003, 04:50 PM   #2
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
Erm, ever tried man chown or reading the LQ Glossary of related terms like chmod?

Last edited by Proud; 01-19-2003 at 04:51 PM.
 
Old 01-19-2003, 05:07 PM   #3
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 68
When you say it didn't work, what exactly do you mean? Also, you probably don't need to change it back, but if you want to:
chown -R root:root /usr/src/redhat

Or you can also check out other options of what to change it to. Again though, I really wouldn't worry too much about it.

Cool
 
Old 01-19-2003, 05:25 PM   #4
illtbagu
Member
 
Registered: Dec 2002
Location: Nevada
Distribution: fedora, RHEL, ubuntu, suse
Posts: 343

Original Poster
Rep: Reputation: 30
http://corefonts.sourceforge.net/ is where i got the command from but if you dont think i need to change it back to what it was ill leave it the way it is. i thought though for security reasons that it might be a good idea to have only root access to this dir.

[root@dhcp-346-5 joe]# chown -R $root /usr/src/redhat
chown: too few arguments
Try `chown --help' for more information.
[root@dhcp-346-5 joe]#


thanks,
AD
 
Old 01-19-2003, 05:38 PM   #5
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 68
That's not really a directory I'd worry too much about, however if you are concerned, go right ahead, no biggie, just use the command from above:
chown -R root:root /usr/src/redhat

The $USER just meant to use the user you were currently running as, now to switch it back you'll need to use an actual name, or uid, which will work with root:root

Cool
 
Old 01-21-2003, 04:13 AM   #6
sorryouttolunch
LQ Newbie
 
Registered: Jan 2003
Distribution: broad
Posts: 2

Rep: Reputation: 0
Hmm, that was a helpful reply there from 'proud'. Why waste so many characters when all you meant was RTFM? I'm new round here, so sorry if saying that's against site ettiquette.

illtbagu - the reason your command says 'too few arguments' is because the arg you are passing - $root is a bash parameter (like a shell variable). What you actually want to give is root, the name of the root user, or simply 0 - no dollarsign! $ is a special char in bash which means 'the word succeding me is a variable/parameter name'. By default these variables/parameters are empty so your command is getting expanded to:

# chown -R /usr/src/redhat

which is a bad because you must supply a username to chown.

What you meant was probably:

# chown -R root /usr/src/redhat

the stuff masterc mentions about using root:root that will also set the group to root. It's a more complete way of doing it.


Bryn
For more info on shell vars and params, do a man bash.
 
Old 01-21-2003, 09:57 AM   #7
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 68
Nice explaination. Yeah, sometimes a "check out the man page on chown" is a perfectly fine answer, other times, such as this, I doubt the manpage would help. They form in which they posed chown wasn't wrong, just the person to whom they were trying give ownership was. I don't think the man page would really cover that.

Thanks for the further explaination sorryouttolunch.
 
Old 01-21-2003, 11:18 AM   #8
sorryouttolunch
LQ Newbie
 
Registered: Jan 2003
Distribution: broad
Posts: 2

Rep: Reputation: 0
Smile

Cheers! Yeah, what I was trying to get at was that the guy's problem was with bash expansions not chmod... in that respect I thought 'do a man chown' was a bit mean ;-)

Your reply was totally right in what it said. Infact, i woulda forgot to say root:root so it woulda been better than one from me on its own... i really must stop being lazy about group ownerships *sigh*

byeee4now
 
Old 01-21-2003, 01:36 PM   #9
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
Sorry guys...but at least he knows of man pages and the LQ Glossary now
 
  


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
Question about /usr/src/redhat/RPMS/subdirs stefaandk Fedora 1 06-23-2005 02:23 AM
rpmbuild doesn't produce the source code in /usr/src/redhat/BUILD Niceman2005 Linux - Software 2 11-29-2004 05:58 PM
/usr/src/??? iain.ross Linux - Software 5 08-24-2004 02:18 PM
how do I chown a PHP file on /usr/ to allow EVERYONE to include it? cpanelskindepot Programming 2 07-16-2004 03:36 PM
Creating /usr/src/linux-<xx> from kernel.<xx>.src.rpm jmourik Linux - Newbie 2 02-19-2003 03:24 PM


All times are GMT -5. The time now is 04:24 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration