LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Changing or copying permissions (https://www.linuxquestions.org/questions/linux-newbie-8/changing-or-copying-permissions-766839/)

Micik 11-04-2009 11:07 AM

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

catkin 11-04-2009 11:13 AM

Have a look at the chmod man page.

Micik 11-04-2009 11:18 AM

I've done that, but still not sure how to form numbers to match some patters such as -rwxr-x---...

ammorais 11-04-2009 11:35 AM

Check here:

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


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