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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
01-19-2003, 04:46 PM
|
#1
|
Member
Registered: Dec 2002
Location: Nevada
Distribution: fedora, RHEL, ubuntu, suse
Posts: 343
Rep:
|
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
|
|
|
01-19-2003, 04:50 PM
|
#2
|
Senior Member
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794
Rep:
|
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.
|
|
|
01-19-2003, 05:07 PM
|
#3
|
LQ Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613
Rep:
|
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
|
|
|
01-19-2003, 05:25 PM
|
#4
|
Member
Registered: Dec 2002
Location: Nevada
Distribution: fedora, RHEL, ubuntu, suse
Posts: 343
Original Poster
Rep:
|
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
|
|
|
01-19-2003, 05:38 PM
|
#5
|
LQ Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613
Rep:
|
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
|
|
|
01-21-2003, 04:13 AM
|
#6
|
LQ Newbie
Registered: Jan 2003
Distribution: broad
Posts: 2
Rep:
|
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.
|
|
|
01-21-2003, 09:57 AM
|
#7
|
LQ Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613
Rep:
|
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.
|
|
|
01-21-2003, 11:18 AM
|
#8
|
LQ Newbie
Registered: Jan 2003
Distribution: broad
Posts: 2
Rep:
|
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
|
|
|
01-21-2003, 01:36 PM
|
#9
|
Senior Member
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794
Rep:
|
Sorry guys...but at least he knows of man pages and the LQ Glossary now
|
|
|
All times are GMT -5. The time now is 06:41 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|