Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How can I copy all the files attributes of file B, into file A in command line ? (A & B are differents)

ex: A user user 666, B root root 770

result --> A root root 770

thanks

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted
chown --reference=B A
chmod --reference=B A

This works on Linux/GNU. On other systems you might need to go a more complicated route, or install the GNU coreutils.

share|improve this answer
add comment

You should be able to use chmod --reference=B A

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.