Huh. tar tf
and unzip -l
. I'm not sure I'd even bother to write a shell function to combine them, much less install software.
Zips just exploding to files is so common, if you just mkdir unzpd ; unzip -d unzpd file.zip
it's going to be right nearly all of the time. Same with tarballs always containing a directory; it's just so common it's barely worth checking.
You write the tools you need, don't get me wrong. This seems like, at most, a 10-line bash function, and even that seems excessive.
function pear() {
case $1 in
*.zip)
unzip -l "$1"
;;
*.tar.*)
tar tf "$1"
;;
esac
}