title: UNIX / Linux / Mac OSX get permission of file as number
body: <p>This must be really simple to do but have completely drawn a blank.  I can see the permission of files by using ls -la which can give something like:</p>
  
  <pre><code>-rwxr-xr-x   1 james  staff   68  8 Feb 13:33 basic.sh*
  -rw-r--r--   1 james  staff   68  8 Feb 13:33 otherFile.sh*
  </code></pre>
  
  <p>How do I translate that into a number for use with <code>chmod</code> like <code>chmod 755 otherFile.sh</code> (with out doing the manual conversion).</p>