Yes. (not sure if you wanted it actually posted the GS way is kinda long) there are a good 10+ different tools to do it on command line though. Even imagemagick's "convert" command that does virtually every image format can also rotate a pdf. qpdf, pdftk are very popular too.
I actually found a thread that lists all the tools I did and even the "gs" command lol https://unix.stackexchange.com/questions/394065/command-line-how-do-you-rotate-a-pdf-file-90-degrees
