LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 03-24-2014, 11:57 AM   #1
sryzdn
Member
 
Registered: Feb 2013
Posts: 248

Rep: Reputation: 1
a question on chmod


Hi,

On the man page of "chmod" on line 90 or so it says:

Quote:
--reference=RFILE
use RFILE's mode instead of MODE values
Could anyone kindly let me have an example to understand it better?
 
Old 03-24-2014, 12:12 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,130
Blog Entries: 2

Rep: Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825
It means that the file you want to chmod will get the permissions set like the file you specified with the --reference parameter. For example:
Code:
>>> ls -l                                                                    
total 0
---x--x--x 1 tobi users 0 Mar 24 17:10 A
-rw-r--r-- 1 tobi users 0 Mar 24 17:10 B

>>> chmod --reference=B A
>>> ls -l                                                                    
total 0
-rw-r--r-- 1 tobi users 0 Mar 24 17:10 A
-rw-r--r-- 1 tobi users 0 Mar 24 17:10 B
 
1 members found this post helpful.
  


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
Apache: difference between chmod 644 and chmod 666 and chmod 600 for output/txt/dat? frenchn00b Programming 6 04-22-2009 02:10 PM
chmod question mateamargo Linux - General 4 03-10-2007 04:01 PM
chmod question curtisf14 Linux - Newbie 4 07-23-2006 04:05 AM
chmod question Napalm Llama Linux - General 2 06-17-2005 10:17 AM
chmod question tongar Linux - Newbie 2 01-30-2005 03:43 PM


All times are GMT -5. The time now is 08:42 AM.

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