Created
July 26, 2017 01:42
-
-
Save seanmceligot/11beecf5fd5eeee3ad030d0061469d8e to your computer and use it in GitHub Desktop.
use strace to see what files are opened by a command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [sean@arch ansible]$ strace date 2>&1 | grep open | |
| open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/usr/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/etc/localtime", O_RDONLY|O_CLOEXEC) = 3 | |
| [sean@arch ansible]$ strace touch foo 2>&1 | grep open | |
| open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/usr/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3 | |
| open("foo", O_WRONLY|O_CREAT|O_NOCTTY|O_NONBLOCK, 0666) = 3 | |
| [sean@arch ~]$ strace python -mfoo 2>&1 | grep open | |
| open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/usr/lib/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/usr/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/usr/lib/libpython3.6m.so.1.0", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/usr/lib/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/usr/lib/libutil.so.1", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/usr/lib/libm.so.6", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/usr/lib/gconv/gconv-modules.cache", O_RDONLY) = -1 ENOENT (No such file or directory) | |
| open("/usr/lib/gconv/gconv-modules", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/usr/bin/pyvenv.cfg", O_RDONLY) = -1 ENOENT (No such file or directory) | |
| open("/usr/pyvenv.cfg", O_RDONLY) = -1 ENOENT (No such file or directory) | |
| open("/usr/lib/python3.6", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3 | |
| pen("/usr/lib/python3.6/encodings/__pycache__/__init__.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/usr/lib/python3.6/__pycache__/codecs.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/usr/lib/python3.6/encodings", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3 | |
| open("/usr/lib/python3.6/encodings/__pycache__/aliases.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/usr/lib/python3.6/encodings/__pycache__/utf_8.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/usr/lib/python3.6/encodings/__pycache__/latin_1.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/usr/lib/python3.6/__pycache__/io.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/usr/lib/python3.6/__pycache__/abc.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/usr/lib/python3.6/__pycache__/_weakrefset.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/usr/lib/python3.6/__pycache__/_bootlocale.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/usr/lib/python3.6/__pycache__/site.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/usr/lib/python3.6/__pycache__/os.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/usr/lib/python3.6/__pycache__/stat.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/usr/lib/python3.6/__pycache__/posixpath.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/usr/lib/python3.6/__pycache__/genericpath.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/usr/lib/python3.6/__pycache__/_collections_abc.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/usr/lib/python3.6/__pycache__/_sitebuiltins.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/usr/lib/python3.6/__pycache__/sysconfig.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/usr/lib/python3.6/__pycache__/_sysconfigdata_m_linux_x86_64-linux-gnu.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/usr/lib/python3.6/site-packages", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3 | |
| open("/usr/lib/python3.6/site-packages/matplotlib-2.0.2-py3.6-nspkg.pth", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/usr/lib/python3.6/__pycache__/types.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 4 | |
| open("/usr/lib/python3.6/__pycache__/functools.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 4 | |
| open("/usr/lib/python3.6/collections/__pycache__/__init__.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 4 | |
| open("/usr/lib/python3.6/__pycache__/operator.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 4 | |
| open("/usr/lib/python3.6/__pycache__/keyword.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 4 | |
| open("/usr/lib/python3.6/__pycache__/heapq.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 4 | |
| open("/usr/lib/python3.6/lib-dynload", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 4 | |
| open("/usr/lib/python3.6/lib-dynload/_heapq.cpython-36m-x86_64-linux-gnu.so", O_RDONLY|O_CLOEXEC) = 4 | |
| open("/usr/lib/python3.6/__pycache__/reprlib.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 4 | |
| open("/usr/lib/python3.6/__pycache__/weakref.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 4 | |
| open("/usr/lib/python3.6/collections", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 4 | |
| open("/usr/lib/python3.6/collections/__pycache__/abc.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 4 | |
| open("/usr/lib/python3.6/importlib/__pycache__/__init__.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 4 | |
| open("/usr/lib/python3.6/__pycache__/warnings.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 4 | |
| open("/usr/lib/python3.6/importlib", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 4 | |
| open("/usr/lib/python3.6/importlib/__pycache__/util.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 4 | |
| open("/usr/lib/python3.6/importlib/__pycache__/abc.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 4 | |
| open("/usr/lib/python3.6/importlib/__pycache__/machinery.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 4 | |
| open("/usr/lib/python3.6/__pycache__/contextlib.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 4 | |
| open("/usr/lib/python3.6/site-packages", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 4 | |
| open("/home/sean", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3 | |
| open("/usr/lib/python3.6/__pycache__/runpy.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 3 | |
| open("/usr/lib/python3.6/__pycache__/pkgutil.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment