Extract files from a binary, specifying the output directory

binwalk

binwalk --extract --directory {{output_directory}} {{path/to/binary}}

click the source code to copy install binwalk on any operating system with command-not-found.com