Howto replicate file permissions using another file as reference

As you may know that chmod command allows you to set certain permissions for files on your Web server. This command is commonly used to set permissions for Perl CGI scripts and the files that go with them. For instance, many scripts are set with the permissions for the owner to be able to read, write, and execute the file; while the permissions for the group and other (anybody) are set to allow them only read and execute permissions.

If you already have a file with the permissions you want to assign to some other files, you can use –reference option in chmod. Of course, remember you need to be the root or admin to do so.

Command
$ chmod –reference

Example
$ chmod –reference 1.cgi 2.cgi
(then you will see that both cgi files are the same permission using ls -al)

Simple as 123~

jonboy60

I’m a Malaysian, my name is Jon Loh (jonboy60) living in Kuala Lumpur and working in Petaling Jaya, Malaysia. Jonboy60.com is a blog magazine about Linux and other open source softwares. All about to a daily jobs or real life experiences I had since the year 2002 administrating Linux and Windows server in a hosting company. Basically i will be offering Linux tips, howto, tricks, latest news and tutorial. Contact Me for Career opportunities, business offers, Linux solutions for business or home, web and email server solutions, Linux consulting and expertise requests. Email to me on jonboy60{@}gmail.com. The site I’m running is VenCouture.com – Malaysia Online Fashion Shopping Boutique, VenCouture. We sell fashion clothes, sexy lingeries, baby clothing and etc.

More PostsWebsite

Follow Me:
TwitterFacebook

Leave a Reply

Your email address will not be published. Required fields are marked *

Connect with Facebook

*


+ 1 = 9

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CommentLuv badge