LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 06-11-2009, 06:22 PM   #1
tigertim71
Member
 
Registered: Oct 2008
Location: London, England
Distribution: Puppy
Posts: 93

Rep: Reputation: 15
chmod/chgrp/chown etc.


Hi,

I've done su before doing the above commands eg.
Code:
su

chmod 644 tims-text
chgrp board tims-text
I am getting this message, even when I
Code:
cd
Code:
pwd
in root:

Code:
chmod: cannot access `tims-text': No such file or directory
and am getting nowhere - any ideas?
 
Old 06-11-2009, 06:33 PM   #2
jamescondron
Member
 
Registered: Jul 2007
Location: Scunthorpe, UK
Distribution: Ubuntu 8.10; Gentoo; Debian Lenny
Posts: 961

Rep: Reputation: 69
Well, at a guess, I'd say the file doesn't exist in that location.
 
Old 06-11-2009, 08:39 PM   #3
j1alu
Member
 
Registered: Apr 2009
Distribution: debian gnu/linux
Posts: 798

Rep: Reputation: Disabled
hi,
when you run cd as root, you go to /root, you need to cd /home/username/documents.
(if tims_file is in /home/username/documents)
 
Old 06-13-2009, 08:36 AM   #4
tigertim71
Member
 
Registered: Oct 2008
Location: London, England
Distribution: Puppy
Posts: 93

Original Poster
Rep: Reputation: 15
chmod/chgrp/chown

This stage appears to be ok - I went to ls -l, but there doesn't seem to be any changes in the preliminary numbers.

Code:
drwxr-xr-x 2 tim7 tim7 4096 2009-06-11 23:13 CV
-rw-r--r-- 1 tim7 tim7  951 2009-06-02 23:13 fstab
-rw-r--r-- 1 tim7 tim7    7 2009-06-07 19:25 mikes
-rw-r--r-- 1 tim7 tim7    6 2009-06-07 19:22 mikes-text

What's the number to make a file read only (so I'm guessing a number will change somewhere) & can I delete it afterwards?
 
Old 06-13-2009, 08:46 AM   #5
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
Take a look at
http://en.wikipedia.org/wiki/File_system_permissions
 
Old 06-13-2009, 09:15 AM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by tigertim71 View Post
This stage appears to be ok - I went to ls -l, but there doesn't seem to be any changes in the preliminary numbers.

Code:
drwxr-xr-x 2 tim7 tim7 4096 2009-06-11 23:13 CV
-rw-r--r-- 1 tim7 tim7  951 2009-06-02 23:13 fstab
-rw-r--r-- 1 tim7 tim7    7 2009-06-07 19:25 mikes
-rw-r--r-- 1 tim7 tim7    6 2009-06-07 19:22 mikes-text

What's the number to make a file read only (so I'm guessing a number will change somewhere) & can I delete it afterwards?
I can't relate this to your original question......

read-only for all users:
chmod 444 filename

read=4
write=2
execute=1

Add the numbers to get the combination you want--the numbers for the example you show are 644.
 
Old 06-13-2009, 05:34 PM   #7
tigertim71
Member
 
Registered: Oct 2008
Location: London, England
Distribution: Puppy
Posts: 93

Original Poster
Rep: Reputation: 15
chmod/chgrp/chown etc.

OK- I basically found what I was looking for.

With
Code:
chmod 444 mikes
I got (after using cmd
Code:
ls -l
):

-r--r--r-- 1 tim7 tim7 7 2009-06-07 19:25 mikes

and with
Code:
chmod 644 mikes
:

-rw-r--r-- 1 tim7 tim7 7 2009-06-07 19:25 mikes

so I'm guessing that this is simply the difference between a file with read only and read-write permissions.

What I wanted to do was just understand the second stage, and how I could confirm that these commands had been executed.
 
Old 06-14-2009, 09:48 AM   #8
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
If you don't get an error message, then you should be able to assume that the command was executed correctly. If in doubt do ls -l to check.
 
  


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
really screwy permissions error involving chmod, chgrp, chown Ryzol Linux - Software 1 03-27-2008 12:36 AM
Using chown, chgrp, chmod on a vfat partition? Rodolfo Medina Linux - General 7 08-17-2005 09:17 AM
Chmod ,chown ,chgrp commands not working proper---------------- pal Linux - Newbie 12 03-07-2005 10:55 AM
chmod ,chown ,chgrp------------ pal Linux - Newbie 1 02-27-2005 03:49 PM
chown, chgrp Help Icarus1701 Linux - Newbie 1 10-25-2004 07:42 PM


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