title: Linux Script to find desired output related to file permissions
body: <pre><code>ls -alR | awk '{k=0; for(i=0;i&lt;=8;i++) k+=((substr($1, i+2, 1)~/[rwx]/)*2^(8-i)); if(k)printf("%o", k); print}' | cut -c 1-3 | sort -n | uniq -c | cut -d " " -f 6-8
  </code></pre>
  
  <p>Output : </p>
  
  <pre><code> 1 .:
  ./.
   1 ./b
   2 ./D
   1 ./M
   2 ./o
   1 ./P
   1 ./T
  tot
   1 ./V
   1 1./
   1 4./
   2 10.
   1 40.
   2 500
  
  20 640
  644
  
  700
  78 755
   3 764
  77 775
   6 777
  </code></pre>
  
  <p>Desired Output: Only count of files grouped by file permissions.
  e.g.</p>
  
  <pre><code>2 774
  3 664
  </code></pre>