LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 05: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, 05:33 PM   #2
jamescondron
Member
 
Registered: Jul 2007
Location: Scunthorpe, UK
Distribution: Ubuntu 8.10; Gentoo; Debian Lenny
Posts: 961

Rep: Reputation: 70
Well, at a guess, I'd say the file doesn't exist in that location.
 
Old 06-11-2009, 07: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, 07: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, 07:46 AM   #5
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

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

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
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, 04: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, 08:48 AM   #8
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:05 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