title: Why copied file has different permissions in Linux?
body: <p>I am logged in as root in Linux. I have a file with 777 permissions. I copied the file in the same directory with <code>cp</code>.</p>
  
  <pre><code>cp settings.php settings_copy.php
  </code></pre>
  
  <p>However, the copied file has different file permissions.</p>
  
  <pre><code>[root@localhost default]# ls -l setting*
  -rwxr-xr-x. 1 root root 29105 Apr 26 11:48 settings_copy.php
  -rwxrwxrwx. 1 root root 29105 Apr 26 09:48 settings.php
  </code></pre>
  
  <p>Is this normal? How can I ensure that the copied file gets the same permissions? I believe that it is the default behaviour for the copy command in any OS. </p>