LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-18-2012, 11:20 PM   #16
DaneM
Member
 
Registered: Oct 2003
Location: Chico, CA, USA
Distribution: Linux Mint
Posts: 881

Rep: Reputation: 130Reputation: 130

Thanks; I'm glad you found it helpful. :-)

Quote:
Like this?
sudo chown cat@ztcat:cat@ztcat hplip-3.12.6
Not quite. While I suppose there's a way to specify the machine's name (I assume that's what you're trying to do) as part of the command, this isn't usually done or necessary, and I don't think that syntax is correct.

Do this, instead. (I assume that your username is, "cat" and that your computer's name is. "ztcat".)

Code:
sudo chown cat:cat hplip-3.12.6
Note that the machine's name is not needed.

Edit: If "hplip-3.12.6" is a directory, not a file, you need to add "-R" (hyphen capital "R") to the end of the command, like this:

Code:
sudo chown cat:cat hplip-3.12.6 -R
This way, you get all the files in that directory changed to be owned by you--not just the directory, itself. (End of edit.)

To clarify:

"sudo" makes you root for just one command.
"chown" is the "CHange OWNership" command.
"cat:cat" represents the "cat" user and the "cat" group (user:group)--since normally each user has his own "home group." If you wanted all users on your computer to access the file in some ways, you can use, "cat:users", instead. Almost always, you want to just use your own group (username:username).

I could not immediately find how to specify a machine name with chown, but I sincerely doubt that you need to do so for your normal use, anyway. (Maybe if you were running a complicated network server...) For now, just use the "username:username" or "username:somegroup" notation.

If ever you want to keep the ownership "as-is" and modify permissions (read, write, execute, etc.) on a file or directory, that link to the "chmod" tutorial will get you started.

I hope this is clearer than my last post.

Good luck!

--Dane

Last edited by DaneM; 07-18-2012 at 11:23 PM.
 
1 members found this post helpful.
Old 07-19-2012, 02:12 AM   #17
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484

Original Poster
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
Originally Posted by DaneM View Post
Thanks; I'm glad you found it helpful. :-)



Not quite. While I suppose there's a way to specify the machine's name (I assume that's what you're trying to do) as part of the command, this isn't usually done or necessary, and I don't think that syntax is correct.

Do this, instead. (I assume that your username is, "cat" and that your computer's name is. "ztcat".)

Code:
sudo chown cat:cat hplip-3.12.6
Note that the machine's name is not needed.

Edit: If "hplip-3.12.6" is a directory, not a file, you need to add "-R" (hyphen capital "R") to the end of the command, like this:

Code:
sudo chown cat:cat hplip-3.12.6 -R
This way, you get all the files in that directory changed to be owned by you--not just the directory, itself. (End of edit.)

To clarify:

"sudo" makes you root for just one command.
"chown" is the "CHange OWNership" command.
"cat:cat" represents the "cat" user and the "cat" group (user:group)--since normally each user has his own "home group." If you wanted all users on your computer to access the file in some ways, you can use, "cat:users", instead. Almost always, you want to just use your own group (username:username).

I could not immediately find how to specify a machine name with chown, but I sincerely doubt that you need to do so for your normal use, anyway. (Maybe if you were running a complicated network server...) For now, just use the "username:username" or "username:somegroup" notation.

If ever you want to keep the ownership "as-is" and modify permissions (read, write, execute, etc.) on a file or directory, that link to the "chmod" tutorial will get you started.

I hope this is clearer than my last post.

Good luck!

--Dane
Thank you, but I am still struggling-
I opened the terminal and followed your written instruction....What have I done incorrectly?

Last edited by Ztcoracat; 07-19-2012 at 02:34 AM. Reason: Command not working
 
Old 07-19-2012, 02:37 AM   #18
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484

Original Poster
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Unhappy

I opened the terminal and tried:

Code:
cat@ztcat:~$ sudo chown cat:cat hplip-3.12.6
chown: cannot access `hplip-3.12.6': No such file or directory
cat@ztcat:~$ 
cat@ztcat:~$ 
cat@ztcat:~$ sudo chown cat:cat hplip-3.12.6 -R
chown: cannot access `hplip-3.12.6': No such file or directory
cat@ztcat:~$ sudo chown cat:cat cd Desktop hplip-3-12.16
chown: cannot access `cd': No such file or directory
chown: cannot access `hplip-3-12.16': No such file or directory
cat@ztcat:~$
I'm really starting to get discouraged now-
 
Old 07-19-2012, 04:17 AM   #19
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484

Original Poster
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
I ended up using the command:
Code:
gksudo nautilus
I right clicked on the file on my desktop and moved it to my home folder.
 
Old 07-19-2012, 07:42 AM   #20
Randicus Draco Albus
Senior Member
 
Registered: May 2011
Location: Hiding somewhere on planet Earth.
Distribution: No distribution. OpenBSD operating system
Posts: 1,711
Blog Entries: 8

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
I am only a shell command beginner, so I may be wrong.
Is only the file name sufficient or should the file path precede the file?
Such as
Code:
chown cat:cat /home/cat/desktop/hplip-3.12.6
or whatever the exact file is? If my hunch is correct, that would explain why the file "does not exit."
If I am wrong, ignore me.
 
2 members found this post helpful.
Old 07-19-2012, 08:58 AM   #21
DaneM
Member
 
Registered: Oct 2003
Location: Chico, CA, USA
Distribution: Linux Mint
Posts: 881

Rep: Reputation: 130Reputation: 130
ztcoracat and Randicus,

Randicus' hunch is correct:

Code:
chown cat:cat /home/cat/desktop/hplip-3.12.6
If this is where the file is located (on your Desktop), then this will do the job. Just remember that the D in "Desktop" is usually capitalized.

ztoracat, your problem, above, is that you're in the wrong directory! The file exists on your Desktop, not in your home directory. The "~" symbol in your command prompt tells you that you're in your home directory, /home/cat. ~ always points to the home directory of the current user, FYI. To solve your problem on the command-line, you need to Change Directory ("cd") to the Desktop and then set the ownership of your file. I now this sounds like a lot of work, but it's often easier than using nautilus, once you get the hang of it. Also, it's safer since you're only root for a second or so.

If you know the location of the file, and don't feel like "cd"-ing there, you can put the full path to the file in the command, as shown, in Randicus' example, above (but use a capital "D" for "Desktop"). Alternatively, you can "cd" to the location, like this:

Code:
ls
<read the output>
cd directoryname
ls
<read the output to make sure you've found the file>
<repeat these steps until you're in the right place>
sudo chown cat:cat filename
"ls" stands for, "list," and will "list" the contents of the current directory. Read the output to see what's present, and where you need to go. If you want to look into a directory without going there, do this:

Code:
ls directoryname

OR

ls directoryname1/directoryname2/directoryname3
(This is if you want to see several steps ahead, at once.)

OR

ls /home/cat/Desktop
(This method starts at the root of the filesystem and lets you see anything you type in.)
This way you can know if your file is in a directory before you go there.

If the "ls" output is too much for one screen, you can "pipe" it to the "less" command to scroll, like this:

Code:
ls | less

OR

ls directoryname | less
This is very useful! Press "q" to quit the scrolling program when you've read what you needed to. The "pipe" character is located below the Backspace key, on the same key as \ (backslash) on a QWERTY keyboard--so press SHIFT and \ to get it.

"cd directoryname" "Changes Directory" to the place you specify, such as, "cd Desktop" or "cd /home/cat/Desktop" (the first is for if you're in /home/cat already).
"ls" again to make sure you've gotten to the place where the file is.
Finally, you use "sudo" to be root and "chown" to modify the ownership of the file.

Go here for lots of good instruction on how to use the command-line:

http://tldp.org/LDP/gs/node5.html

tldp.org (The Linux Documentation Project) is full of good stuff for newbies and gurus, alike!

I hope this helps.

--Dane

Last edited by DaneM; 07-19-2012 at 09:09 AM. Reason: More information.
 
1 members found this post helpful.
Old 07-19-2012, 09:02 AM   #22
DaneM
Member
 
Registered: Oct 2003
Location: Chico, CA, USA
Distribution: Linux Mint
Posts: 881

Rep: Reputation: 130Reputation: 130
Also: if you're feeling adventurous, in this other thread, I tell the asker how to always know where he is on the command-line. The basic information about "pwd" and such is easy for everyone; the editing of the PS1 command should probably wait until you're more familiar with how the system works.

http://www.linuxquestions.org/questi...le-4175417094/
 
Old 07-19-2012, 04:59 PM   #23
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484

Original Poster
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Wink

Randicus & Dane:

I have written down the examples that you both have given me.

The file is not longer on my Desktop it now resides in my Home Folder.

I'm not sure why it's been so hard for me to understand the way and in the order in which files and directories are to be typed out . I think I need to go to http://tipd.org/LDP/gs/node.5.html read and learn.
I had to do something right because I was able to open the terminal and after executing the command:
gksudo nautilus
I was able to move it to my Home Folder. I honestly think and feel at this point I don't have the hang of this and don't fully understand the order of how files and directories should be listed in a commmand. But I am not giving up.
This is my OS and my friends can not help because they are Windows users. It's up to me and I am determine....just having some difficulty along the way.

I aknowledge ls stands for list and that I can use the pipe (|) with ls | less
I understand
Code:
chown cat:cat /home/cat/desktop/hplip-3.12.6
So now I'm wondering since this is in my homefolder ( if I've learned anything from both of you) that I have this correct:
Code:
chown cat:cat/home/cat/homefolder/hplip-3.12.6
I'm really trying and do appreciate all that the both of you have written to me. Hope something sinks into this head of mine soon. I'm so sorry that I returned the " Ubuntu Linux Bible" early to my local library. I will go to the websites and learn-
Thank You
 
Old 07-19-2012, 07:45 PM   #24
hda7
Member
 
Registered: May 2009
Distribution: Debian wheezy
Posts: 252

Rep: Reputation: 31
Quote:
Originally Posted by Ztcoracat View Post
Randicus & Dane:

I have written down the examples that you both have given me.

The file is not longer on my Desktop it now resides in my Home Folder.

I'm not sure why it's been so hard for me to understand the way and in the order in which files and directories are to be typed out . I think I need to go to http://tipd.org/LDP/gs/node.5.html read and learn.
I had to do something right because I was able to open the terminal and after executing the command:
gksudo nautilus
I was able to move it to my Home Folder. I honestly think and feel at this point I don't have the hang of this and don't fully understand the order of how files and directories should be listed in a commmand. But I am not giving up.
This is my OS and my friends can not help because they are Windows users. It's up to me and I am determine....just having some difficulty along the way.

I aknowledge ls stands for list and that I can use the pipe (|) with ls | less
I understand
Code:
chown cat:cat /home/cat/desktop/hplip-3.12.6
So now I'm wondering since this is in my homefolder ( if I've learned anything from both of you) that I have this correct:
Code:
chown cat:cat/home/cat/homefolder/hplip-3.12.6
I'm really trying and do appreciate all that the both of you have written to me. Hope something sinks into this head of mine soon. I'm so sorry that I returned the " Ubuntu Linux Bible" early to my local library. I will go to the websites and learn-
Thank You
Your home folder is normally just '/home/<username>', in your case
'/home/cat' (most of the time you can use '~' for your home directory
as a convenience). I would take the advice given and do 'ls' in that
directory. If you see the file in the resulting list, you know you're
in the correct directory. If it is not, and you can't seem to find it
elsewhere, try
Code:
find ~ -name '*hplip*'
(the '*'s will
match anything, so this will find any files/directories with hplip in
the name). If this command outputs a file name, you should be able to
copy it verbatim into the 'chown' command.
 
1 members found this post helpful.
Old 07-20-2012, 12:49 AM   #25
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Code:
chown cat:cat/home/cat/homefolder/hplip-3.12.6

# you MUST have a space between the ownerships and the filename thus
chown cat:cat /home/cat/homefolder/hplip-3.12.6

# and in any case, your 'home dir' would be /home/cat, so
chown cat:cat /home/cat/hplip-3.12.6
unless you've created a dir called 'homefolder'.
Incidentally, its called a dir in Unix, not a folder; that name was only invented (for &) by MS after they came up with their MS-Windows GUI.
 
1 members found this post helpful.
Old 07-20-2012, 06:41 AM   #26
snowday
Senior Member
 
Registered: Feb 2009
Posts: 4,667

Rep: Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411
Another tip is that you can use "tab completion" in the terminal.

For example if you type

Code:
chown cat:cat /home/cat/hp
and then press TAB, if there is indeed a directory called hplip-3.12.6 in your ~ (home), pressing TAB will fill in the rest.
 
2 members found this post helpful.
Old 07-20-2012, 02:03 PM   #27
DaneM
Member
 
Registered: Oct 2003
Location: Chico, CA, USA
Distribution: Linux Mint
Posts: 881

Rep: Reputation: 130Reputation: 130
All good info--especially the find and tab completion stuff.

I just want to point out that if there are multiple files starting with "hplip" when you try to use tab completion, it might give you nothing or a "beep" until you press tab again. This will give you a list of all files that start with "hplip". The same basic idea is accomplished by typing, "ls hplip*".

The find command is one of the best, IMHO. It's a bit hard to get the hang of it if you're just using the "man find" entry, so I'll give some basic usage info, below:

(Also, you can type "man <command>" for almost any command you want to learn how to use.)

Code:
find / -iname *.bin
(This finds all things ending in, ".bin"--starting in the root of the filesystem)

find -iname *.bin
(This is the same thing, but starts in whichever directory you're currently in.)

find -type f
(Finds all files.  If you put a directory name and a space before the "-t", you can choose where to start looking.)

find -type d
(Same as above, but for directories.)

find -type f -iname *hplip*
(Finds all FILES with "hplip" in their names.)

USE THIS NEXT ONE CAREFULLY:
find /home/cat -type f -iname *hplip* -exec chown cat:cat '{}' \;
(This looks in /home/cat for any FILE with "hplip" in its name, then makes it owned by user "cat" and group "cat".  You can do a lot with this type of command.  If used improperly, it can ruin your system, but it's very nice if you do it right.)
For more info, type "man find" in the terminal.
 
1 members found this post helpful.
Old 07-20-2012, 08:10 PM   #28
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484

Original Poster
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176

I didn't know I could use the TAB and it fills in the rest. Thank You Snowpine
It seems that " ls" is good for me to use as well for finding things.
I knew about the "man" command but did not know that it will help me to learn how to use it.
Think I got it.
Type f ...finds all files
Type d... finds all directories
Find /home/cat/ (type f) name - execute
chown cat:cat

I have read about 1/2 of the Command Line Inst's @
http://tldp.org/LDP/gs/node5.html
And it is helping me to understand. Thank You Dane

I hope to find more Linux website to help me understand and learn so I can navigate better and think efficently for the right commands to type into the terminal. For what I've been able to tell this takes time. With time I hope to get the hang of your instructions so that they come more easily.

The Ubuntu Community Documentation is ok but it's somewhat overwhelming as there is so much to read.

Last edited by Ztcoracat; 07-20-2012 at 08:11 PM. Reason: Correct grammer
 
Old 07-20-2012, 08:14 PM   #29
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484

Original Poster
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
Originally Posted by hda7 View Post
Your home folder is normally just '/home/<username>', in your case
'/home/cat' (most of the time you can use '~' for your home directory
as a convenience). I would take the advice given and do 'ls' in that
directory. If you see the file in the resulting list, you know you're
in the correct directory. If it is not, and you can't seem to find it
elsewhere, try
Code:
find ~ -name '*hplip*'
(the '*'s will
match anything, so this will find any files/directories with hplip in
the name). If this command outputs a file name, you should be able to
copy it verbatim into the 'chown' command.
Advise taken- ( ls )
Thank You very much
 
Old 07-20-2012, 09:14 PM   #30
DaneM
Member
 
Registered: Oct 2003
Location: Chico, CA, USA
Distribution: Linux Mint
Posts: 881

Rep: Reputation: 130Reputation: 130
I'm glad it's working out for you, Ztoracat.

Just a reminder: it's not, "type f"; it's "-type f". Without the dash, you'll get an error.

If you think you're "all set" on this, please use the link at the top of the page to mark the thread as "[SOLVED]". Otherwise, let us know what you need.

--Dane
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Permissions Denied kapilbajpai88 Linux - Newbie 4 11-24-2008 05:06 PM
Permissions denied dms05 Linux - Newbie 7 11-03-2007 03:31 PM
permissions denied mrbrucelee Linux - General 8 06-29-2006 02:29 PM
ALL permissions denied for root larry_linux Linux - Newbie 9 09-13-2005 12:15 AM
Denied Permissions Jeebizz Slackware 4 09-05-2004 03:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:31 PM.

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