Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> Chmod A+rw, What does the "a" mean?
Termina
post Mar 31 2004, 01:16 PM
Post #1


RMS is my Hero
******

Group: Support Specialist
Posts: 862
Joined: 18-February 04
From: Wisconsin
Member No.: 2,404



Sorry, that's supposed to be a lowercase "a" up there.

Been reading around, and I saw this command. Was wondering what the "a" does.

*Is hoping it continously makes sure that the file is rw* Which would be cool. happy.gif


--------------------
*Points finger at the author above him* They're a witch! Burn them!
---
Vist my website!
Join me in IRC! Server: st0rage.org Channel: #UnhandledExceptions
Go to the top of the page
 
+Quote Post
Robert83
post Mar 31 2004, 01:30 PM
Post #2


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,439
Joined: 3-January 04
From: Germany
Member No.: 2,069



Hi,

a means all users

the + means that the new rules are added to the existing rules of the file, so my guess would be

if a file is r and x

and if you do a chmod +w it will be rwx

Sincerely
Robert B

ps.: Termina do you know anything about that grub thing that I posted earlier ? smile.gif


--------------------
Robert Becskei
robert83@linuxhelp.net
--------------------
May the source be with us!
--------------------
AMD X2-3800 @ 2400Mhz
2048MB DDR 400Mhz
DFI Lanparty UT4 NF4 ULTRA-D
GeForce 7800GT
250GB+250GB
Pioneer DVD-RW
17inch Samsung Syncmaster 757NF
WinXP Pro (SP2)/ CentOS 4.3
--------------------
Go to the top of the page
 
+Quote Post
Termina
post Mar 31 2004, 02:15 PM
Post #3


RMS is my Hero
******

Group: Support Specialist
Posts: 862
Joined: 18-February 04
From: Wisconsin
Member No.: 2,404



Hey, sure. smile.gif I'll give it a shot.

Thanks. =/ Do you know any way to have a file retain it's permissions? (so if anything changes it's permissions, it changes back?) Short of a bash script, contiously running chmod a+rw filename, I have no clue. happy.gif


--------------------
*Points finger at the author above him* They're a witch! Burn them!
---
Vist my website!
Join me in IRC! Server: st0rage.org Channel: #UnhandledExceptions
Go to the top of the page
 
+Quote Post
Robert83
post Mar 31 2004, 03:14 PM
Post #4


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,439
Joined: 3-January 04
From: Germany
Member No.: 2,069



Hi,

I think this bash script would do the job :

CODE
# /bin/bash
PATH = /bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin

chmod 755 your_file_name_here


after you save it as , for example guardian
chmod 755 guardian

and use cron to do it every 5 minutes...

like this
touch mycronjob
and put in it the following line 5 * * * * /home/scripts/guardian
crontab mycronjob

and

crontab -l
to see if it's there and shows up as it should

Sincerely
Robert B


--------------------
Robert Becskei
robert83@linuxhelp.net
--------------------
May the source be with us!
--------------------
AMD X2-3800 @ 2400Mhz
2048MB DDR 400Mhz
DFI Lanparty UT4 NF4 ULTRA-D
GeForce 7800GT
250GB+250GB
Pioneer DVD-RW
17inch Samsung Syncmaster 757NF
WinXP Pro (SP2)/ CentOS 4.3
--------------------
Go to the top of the page
 
+Quote Post
Termina
post Mar 31 2004, 03:17 PM
Post #5


RMS is my Hero
******

Group: Support Specialist
Posts: 862
Joined: 18-February 04
From: Wisconsin
Member No.: 2,404



Was hoping for a way without a bash script (I have one, but I had a bad experiance last time when I made a bad one... it kept the chgrp and chmod proccesses alive for some reason, I ended up having several thousand chgrp/chmod's going at once). happy.gif

Fun stuff. ;-_- I almost had 2 months uptime too (bragging rights... ho ho!)


--------------------
*Points finger at the author above him* They're a witch! Burn them!
---
Vist my website!
Join me in IRC! Server: st0rage.org Channel: #UnhandledExceptions
Go to the top of the page
 
+Quote Post
Hemant
post Mar 31 2004, 10:55 PM
Post #6


RMS is my Hero
******

Group: Support Specialist
Posts: 782
Joined: 6-October 02
From: Trichy,INDIA
Member No.: 29



QUOTE
# /bin/bash
PATH = /bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin

chmod 755 your_file_name_here


I don't think your bash script will revert the permissions...of a file...rather it will set the permission..to 755 for every file...specified....What say you?????isn't it???


--------------------
Hemant Kumar
user posted image
hemant@linuxhelp.net
Go to the top of the page
 
+Quote Post
Robert83
post Apr 1 2004, 01:02 AM
Post #7


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,439
Joined: 3-January 04
From: Germany
Member No.: 2,069



Yes, you are right...

What you would need to do is somehow check the file premission with ls -l and put it into a file,
and after that compare it with the original file every 5 minutes, and if its ok , then do nothing, if it has changed , then revert to the original...but I don't know how to do this.

Sincerely
Robert B


--------------------
Robert Becskei
robert83@linuxhelp.net
--------------------
May the source be with us!
--------------------
AMD X2-3800 @ 2400Mhz
2048MB DDR 400Mhz
DFI Lanparty UT4 NF4 ULTRA-D
GeForce 7800GT
250GB+250GB
Pioneer DVD-RW
17inch Samsung Syncmaster 757NF
WinXP Pro (SP2)/ CentOS 4.3
--------------------
Go to the top of the page
 
+Quote Post
hughesjr
post Apr 1 2004, 07:08 AM
Post #8


Its GNU/Linuxhelp.net
*******

Group: Admin
Posts: 3,433
Joined: 25-July 03
From: Corpus Chrsiti, TX, USA
Member No.: 1,151



we (I smile.gif ) could write a script where you put in the owner, group, file permissions you want and it checks the files (and/or directories) in question and changes the permissions ...

BUT, really, we should instead address what is causing the file permissions to change and try and fix that process so it writes the files the way you want them written in the first place.


--------------------
Johnny Hughes
hughesjr@linuxhelp.net
Enterprise Alternatives: CentOS, WhiteBoxEL
Favorite Workstation Distros (in order): CentOS, Gentoo, Debian Sarge, Ubuntu, Mandrake, FedoraCore, Slackware, SUSE
Favorite Server Distros (in order): CentOS, WhiteBoxEL, Debian Sarge, Slackware, Mandrake, FedoraCore, Gentoo, SUSE
Go to the top of the page
 
+Quote Post
jetblackz
post Apr 2 2004, 08:59 PM
Post #9


./configure
***

Group: Members
Posts: 98
Joined: 1-April 03
Member No.: 613



The a is redundant since no a means a. You can try

chmod a+x file

or

chmod +x file

Results are the same. In the future, you should do

man chmod

for help pages.


--------------------
Go to the top of the page
 
+Quote Post
Hemant
post Apr 3 2004, 06:25 PM
Post #10


RMS is my Hero
******

Group: Support Specialist
Posts: 782
Joined: 6-October 02
From: Trichy,INDIA
Member No.: 29



Basically permissions of a file doesn't changes on the fly..Usually if a program is using a file it doesn't changes the permissions of a file..But sometimes when you access some users home directory as superuser and copy stuff there....the user can read the file but can't delete it..
Or if you change the permissions of a file manually ..like
CODE
$ chmod 646 file_name


So in my opinion it is very much redundant to have such a script.But anyway how will you know the old permissions of a file..so that you can revert to it..
I don't think there is a easy way..out unless you try to have a script that creates a file and stores permissions of a file whose permissions has been changed..and executed at that particular moment..think about it would be really frustrating...

You have writeen a bash script and now you change the permission of file using
CODE
$ chmod +x file_name
$ ./file_name

but second command will give some error because..you lurking bash script will revert the permissions of that file.
Waste of time isn't it....


--------------------
Hemant Kumar
user posted image
hemant@linuxhelp.net
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 14th December 2017 - 10:18 AM