It's not just one line; it's repeated invocations of gs, one per page. You
mentioned unix, so here it is for bash. Assumes you already know how many
pages it is (if you had to, I guess you could capture that from the
original ps2pdf command). We'll cheat and use ps2pdf since it conveniently
handles most of the necessary gs commandline.
ps2pdf -dFirstPage=$i -dLastPage=$i allpage.pdf page$i.pdf