LinuxQuestions.org
Review your favorite Linux distribution.
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 04-27-2005, 09:47 PM   #1
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 610

Rep: Reputation: 31
File Permission


I want to change the user permissions i.e

$ touch myfile
$ls -l myfile

-rw-r--r--

$chmod u=+x myfile

here i also want to give the execute prmission to the user but
the list command shows (Read & Write also removed why ?)
$ls -l
----r--r--

yes the other way is to use the number(Octal) i.e
$chmod 700 myfile

$ls -l myfile

-rwx------

by using 744 with chmod it can show me desire desire result.
plz guide me that how can i adjuct it by using Owner,Group & Others

example chmod u=+r,+w,+x
so that i can view the the user have rwx permission.
Thanks in advance for the guidence.
 
Old 04-27-2005, 10:18 PM   #2
michaelsanford
Member
 
Registered: Feb 2005
Location: Ottawa/Montréal
Distribution: Slackware + Darwin (MacOS X)
Posts: 468

Rep: Reputation: 30
Code:
root@gateway:~# touch file
root@gateway:~# chmod a-rwx,u+rwx file
root@gateway:~# ls -la file
-rwx------  1 root root 0 2005-04-27 22:14 file*
Mixing + and = in a chmod directive seems to confuse the system, since:
Quote:
The operator `+' causes the permissions selected to be added to the existing permissions of each file; `-' causes them to be removed; and `=' causes them to be the only permissions that the file has.

Last edited by michaelsanford; 04-27-2005 at 10:21 PM.
 
Old 04-28-2005, 04:53 AM   #3
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 610

Original Poster
Rep: Reputation: 31
Thanks 'michaelsanford' for the guidence. In some books i saw that they use '+' or '-' sign to remove the permission . In your reply u did't use it & the system also does't give an error message . Still these are confusing me .
Any good site which u recommand me to study more about File permission.

Also what is the difference between ls -l & ls -aF
 
Old 04-28-2005, 07:13 AM   #4
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 74
"ls -l" lists the files in your directory excluding hidden ones. "ls -aF" lists all files ncluding hidden ones and then appends a character to each file to indicate what type of file it is.
 
Old 04-28-2005, 04:28 PM   #5
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Quote:
Any good site which u recommand me to study more about File permission.
This one of course:
http://www.linuxquestions.org/questi...ticle&artid=20
 
Old 04-28-2005, 11:35 PM   #6
michaelsanford
Member
 
Registered: Feb 2005
Location: Ottawa/Montréal
Distribution: Slackware + Darwin (MacOS X)
Posts: 468

Rep: Reputation: 30
Sure I used + and - ... "a-rwx,u+rwx"

Also `man chmod` and `man chown` are good places to look.
 
  


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
File permission help! jorasmi Slackware 7 08-15-2005 11:07 PM
About the file permission ust Linux - Distributions 1 05-06-2005 04:05 AM
The file permission ust Linux - Distributions 1 05-05-2005 05:37 AM
file permission ust Linux - General 3 04-20-2004 07:14 AM
File Permission glock19 Linux - General 4 01-02-2002 08:40 PM


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