Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- find . -type f ( -iname '*foo*' ! -name '.*' )
- import subprocess
- cmd = ["find", ".", "-type", "f", "(", "-iname", "*foo*", "!", "-name", ".*", ")"]
- sp = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- print sp.communicate()[0].split()
- import subprocess
- cmd = 'find . -type f -iname "*foo*" ! -name ".*"'
- sp = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- print sp.communicate()[0].split()
- cmd = "find . -type f -iname *foo* ! -name .\*"
- print(cmd)
- ret = subprocess.run(cmd, shell=True, capture_output=True)
- print(ret)
- $ find . -type f -iname *foo* ! -name .*
- ./foobar.txt
- ./barfoo.txt
- $ ./findfoo.py
- find . -type f -iname *foo* ! -name .*
- CompletedProcess(args='find . -type f -iname \*foo\* ! -name .\*',
- returncode=0, stdout=b'./foobar.txtn./barfoo.txtn', stderr=b'')
- cmd = ["find", ".", "-type", "f", "\(", "-iname", "\*foo\*", "!", "-name", ".\*", "\)"]
- cmd = ["find", ".", "-type", "f", "-iname", "\*foo\*", "!", "-name", ".\*"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement