PROWAREtech
How to Check Which Shared Library Files are Loaded on Linux
See which shared library, a.k.a. .so files, are loaded by a process.
First, find the process identifier (PID). Issue a ps aux command.
user@hostname:~$ ps aux USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 1.4 225152 6828 ? Ss Aug21 0:09 /sbin/init root 2 0.0 0.0 0 0 ? S Aug21 0:00 [kthreadd] root 3 0.0 0.0 0 0 ? I< Aug21 0:00 [rcu_gp] root 4 0.0 0.0 0 0 ? I< Aug21 0:00 [rcu_par_gp] root 6 0.0 0.0 0 0 ? I< Aug21 0:00 [kworker/0:0H-kb] root 9 0.0 0.0 0 0 ? I< Aug21 0:00 [mm_percpu_wq] root 10 0.0 0.0 0 0 ? S Aug21 0:00 [ksoftirqd/0] root 11 0.0 0.0 0 0 ? I Aug21 0:01 [rcu_sched] root 12 0.0 0.0 0 0 ? S Aug21 0:00 [migration/0] root 13 0.0 0.0 0 0 ? S Aug21 0:00 [cpuhp/0] root 14 0.0 0.0 0 0 ? S Aug21 0:00 [kdevtmpfs] root 15 0.0 0.0 0 0 ? I< Aug21 0:00 [netns] root 16 0.0 0.0 0 0 ? S Aug21 0:00 [rcu_tasks_kthre] root 17 0.0 0.0 0 0 ? S Aug21 0:00 [kauditd] root 18 0.0 0.0 0 0 ? S Aug21 0:00 [khungtaskd] root 19 0.0 0.0 0 0 ? S Aug21 0:00 [oom_reaper] root 20 0.0 0.0 0 0 ? I< Aug21 0:00 [writeback] root 21 0.0 0.0 0 0 ? S Aug21 0:00 [kcompactd0] root 22 0.0 0.0 0 0 ? SN Aug21 0:00 [ksmd] root 68 0.0 0.0 0 0 ? I< Aug21 0:00 [kintegrityd] root 69 0.0 0.0 0 0 ? I< Aug21 0:00 [kblockd] root 70 0.0 0.0 0 0 ? I< Aug21 0:00 [blkcg_punt_bio] root 71 0.0 0.0 0 0 ? I< Aug21 0:00 [tpm_dev_wq] root 72 0.0 0.0 0 0 ? I< Aug21 0:00 [ata_sff] root 73 0.0 0.0 0 0 ? I< Aug21 0:00 [md] root 74 0.0 0.0 0 0 ? I< Aug21 0:00 [edac-poller] root 75 0.0 0.0 0 0 ? I< Aug21 0:00 [devfreq_wq] root 76 0.0 0.0 0 0 ? S Aug21 0:00 [watchdogd] root 79 0.0 0.0 0 0 ? S Aug21 0:00 [kswapd0] root 80 0.0 0.0 0 0 ? S Aug21 0:00 [ecryptfs-kthrea] root 82 0.0 0.0 0 0 ? I< Aug21 0:00 [kthrotld] root 83 0.0 0.0 0 0 ? S Aug21 0:00 [xenbus] root 84 0.0 0.0 0 0 ? S Aug21 0:00 [xenwatch]
"lsof -p PID" command
To view the files loaded by a process using its PID (84 in this case), then issue a lsof -p 84 command.
lsof -p 84
Comment