Created
February 27, 2022 22:23
-
-
Save AlexRogalskiy/010f0780e59c61a328cc06fb8149f88a to your computer and use it in GitHub Desktop.
Linux: find all library packages required by all binaries in the current subtree (can take 5-10 minutes)
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
| find -type f -exec file {} \; \ | |
| | awk -F: '/ELF/{print$1}' \ | |
| | xargs -I% readelf -d % \ | |
| | awk '/Shared/{gsub("\\[","",$5);gsub("\\]","",$5);if(length($5)>1){x[$5]++}} END{for(i in x){print i}}' \ | |
| | xargs -L1 apt-file find \ | |
| | awk -F: '{x[$1]++} END{for(i in x){print i}}' \ | |
| | awk '!/32|-dbg$|-i386$/' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment