title: How to use linux command in subprocess python
body: <p>I have linux command like below:</p>
  
  <pre><code> find /data/*/hr/ -printf "%f: %p: %u: %g %m (%M) \n"
  </code></pre>
  
  <p>How do i use in python subprocess check_output</p>
  
  <p>I have tried like below but not working</p>
  
  <pre><code> file_name = "/data/*/%s/" % (filename)
   get_perm = check_output(["find", file_name, "-printf", '\"%f: %p: %u: %g %m (%M) \n\"'])
  </code></pre>
  
  <p>Error I am getting:</p>
  
  
  
  <pre class="lang-html prettyprint-override"><code>find: ‘/data/*/hr/’: No such file or directory
  Traceback (most recent call last):
    File "handover.py", line 90, in &lt;module&gt;
      get_perm = check_output(["find", file_name, "-printf", '\"%f: %p: %u: %g %m (%M) \n\"'])
    File "/usr/lib64/python2.7/subprocess.py", line 573, in check_output
      raise CalledProcessError(retcode, cmd, output=output)
  subprocess.CalledProcessError: Command '['find', '/data/*/hr/', '-printf', '"%f: %p: %u: %g %m (%M) \n"']' returned non-zero exit status 1
  </code></pre>