LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 11-04-2009, 11:07 AM   #1
Micik
Member
 
Registered: Dec 2004
Distribution: open suse
Posts: 137

Rep: Reputation: 15
Changing or copying permissions


Hello,

I need your help about copying permissions from one file to another.
I know that command for changing permission is "chmod", for example chmod 666 filename

However, I have one file filename1 and by listing all contents of a directory with ls -al I can find out its permissions in form -rwwx and similar.
Now I want to define exact same permissions to other file "filename2". How to use chmod command to accomplish this.
Other way around would be to simply copy permissions from one file to another. Is there any command for this purpose?

Thanks
 
Old 11-04-2009, 11:13 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Have a look at the chmod man page.
 
Old 11-04-2009, 11:18 AM   #3
Micik
Member
 
Registered: Dec 2004
Distribution: open suse
Posts: 137

Original Poster
Rep: Reputation: 15
I've done that, but still not sure how to form numbers to match some patters such as -rwxr-x---...
 
Old 11-04-2009, 11:35 AM   #4
ammorais
Member
 
Registered: Nov 2009
Location: Lisbon, Portugal
Distribution: Gentoo, CentOs, Ubuntu, Debian
Posts: 182

Rep: Reputation: 49
Check here:

http://www.freeos.com/articles/3127/
http://www.tuxfiles.org/linuxhelp/filepermissions.html

Last edited by ammorais; 11-04-2009 at 11:37 AM.
 
  


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
copying folder and changing extension of files in it? stratotak Linux - Newbie 18 03-10-2009 01:16 AM
Problem copying files, perhaps due to permissions LSOsheriff Linux - General 4 02-16-2007 08:45 AM
Copying a DVD and changing the region code kenkajoto Linux - Software 4 03-19-2006 03:27 AM
Copying files as root without changing permissions BillyGalbreath Linux - General 3 12-28-2005 08:39 AM
copying permissions bally Linux - General 5 10-25-2003 01:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:16 PM.

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