I have linux command like below:
find /data/*/hr/ -printf "%f: %p: %u: %g %m (%M) \n"
How do i use in python subprocess check_output
I have tried like below but not working
file_name = "/data/*/%s/" % (filename)
get_perm = check_output(["find", file_name, "-printf", '\"%f: %p: %u: %g %m (%M) \n\"'])
Error I am getting:
find: ‘/data/*/hr/’: No such file or directory
Traceback (most recent call last):
File "handover.py", line 90, in <module>
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