if you never care about the binary being in the list  you can use  f to only output libraries  f  n f also  you could speed this up by executing  scanelf  on all your files at once but you are probably only copying a handful of elfs at once  so it is not that big of a deal 