LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   change of permission in cp n mv (https://www.linuxquestions.org/questions/linux-newbie-8/change-of-permission-in-cp-n-mv-425699/)

Jeet 03-17-2006 06:11 AM

change of permission in cp n mv
 
Hi,

In linux when we copy or move one file from one dir to another dir the permission of that file get changed. the permission get change differently incase of cp and mv.

e.g. there is two dir, dir1 n dir2 the permission in dir1is 700 n dir2 is 755. now when the file, file1(having permission 777) from dir2 will be cp or mv to dir1 the permission will get change. i want to know in that case what will be the permission the file1 will get when it will cp or mv? and what is the rule it follows? is there any effect of dir permission in the file???

thank you

spooon 03-17-2006 07:10 AM

Can you show us the output? Are you copying to a location that does not support permissions? Usually, when you move a file the permissions, timestamps, etc. should not change. When you copy a file you are making a new file, so the copy will have the default permissions of a new file; unless you use the -p flag to preserve permissions, timestamps, etc.


All times are GMT -5. The time now is 07:41 AM.