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.
|
 |
04-27-2005, 08:47 PM
|
#1
|
Member
Registered: Oct 2004
Location: LH
Posts: 648
Rep:
|
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.
|
|
|
04-27-2005, 09:18 PM
|
#2
|
Member
Registered: Feb 2005
Location: Ottawa/Montréal
Distribution: Slackware + Darwin (MacOS X)
Posts: 468
Rep:
|
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 09:21 PM.
|
|
|
04-28-2005, 03:53 AM
|
#3
|
Member
Registered: Oct 2004
Location: LH
Posts: 648
Original Poster
Rep:
|
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
|
|
|
04-28-2005, 06:13 AM
|
#4
|
LQ Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298
Rep:
|
"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.
|
|
|
04-28-2005, 03:28 PM
|
#5
|
Senior Member
Registered: Nov 2002
Location: British Columbia, Canada
Distribution: Gentoo x86_64; FreeBSD; OS X
Posts: 3,764
Rep:
|
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
|
|
|
04-28-2005, 10:35 PM
|
#6
|
Member
Registered: Feb 2005
Location: Ottawa/Montréal
Distribution: Slackware + Darwin (MacOS X)
Posts: 468
Rep:
|
Sure I used + and - ... "a-rwx,u+rwx"
Also `man chmod` and `man chown` are good places to look.
|
|
|
All times are GMT -5. The time now is 10:13 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
|
|