How to restore archive logs from backup piece?

If one needs to restore archive logs to disk and not apply them, for example in case when cloning a database manually and one is missing the archive logs from the source database and you need to restore the archive logs on the source machine. So using the following command one can restore the archive logs.

connect target /
connect rcvcat rmancatalog/rmancatalog@catdb

run {
restore archivelog from logseq=36747 until logseq=36753 thread=1;
from logseq – is the starting log sequence #
until logseq – is the end log sequence #