Информация о файле

file /bin/ls



/bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV),

dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=8d0966ce81ec6609bbf4aa439c77138e2f48a471, stripped



print shared library dependencies - Какие библиотеки подгружаются в момент запуска bin

ldd prints the shared libraries required by each program or shared library specified on the command line.

ldd /bin/ls

/mnt/c/Users/info# ldd /bin/ls

`linux-vdso.so.1 => (0x00007fffc4048000)

libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007fb655ac0000)

libacl.so.1 => /lib/x86_64-linux-gnu/libacl.so.1 (0x00007fb6558b0000)

libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb6554d0000)

libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fb655290000)

libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fb655080000)

/lib64/ld-linux-x86-64.so.2 (0x00007fb655e00000)

libattr.so.1 => /lib/x86_64-linux-gnu/libattr.so.1 (0x00007fb654e60000)



ltrace - показать библиотечные вызовы

ltrace /bin/ls



strace - intercept and record the system calls. - Показать библиотечные вызовы

strace /bin/ls [-e filter]



# strace -e open /bin/ls

open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3

open("/lib/x86_64-linux-gnu/libselinux.so.1", O_RDONLY|O_CLOEXEC) = 3

open("/lib/x86_64-linux-gnu/libacl.so.1", O_RDONLY|O_CLOEXEC) = 3

open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3

open("/lib/x86_64-linux-gnu/libpcre.so.3", O_RDONLY|O_CLOEXEC) = 3

open("/lib/x86_64-linux-gnu/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3

open("/lib/x86_64-linux-gnu/libattr.so.1", O_RDONLY|O_CLOEXEC) = 3

open("/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3

open("/proc/filesystems", O_RDONLY) = 3

open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3

1.py 2.py dump tcpdump.sh

+++ exited with 0 +++



dpkg - Find package(s) owning file(s)

dpkg -S /etc/init.d/apache2



List files owned by package(s).

dpkg -L strace



apropos - Find package(s) owning file(s)