Changing or copying permissions
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?