Provided you didn't protect it with a password:
dd if=$1 bs=24 skip=1 | openssl zlib -d >${1%%.ab}.tar
dd is the "Disk Duplicator" (also known as "disk destroyer" in case you confuse its parameters ans switch if and of ;)
bs=23 advises it to use a block size of 24 byte, which we need to…
skip=1 skip 1 block of 24 byte (the "Backup header")
- the output gets piped to
openssl to process and unpack it
- … and the output from that is redirected to a Tarball
From there, you should know your way: simply "untar" (extract) what you want.
Why it uses $1? Well, I copied this line from ab2tar, which is included with my little tool Adebar you might be interested in as well: creates a nice device documentation, backup scripts and more, all via ADB using nothing but Bash 😇 So put that line in a tiny little shell script, and call it:
ab2tar twrp-20170322.ab
Then find a twrp-20170322.tar as result. Of course, this requires openssl to be installed on your Linux machine.