Simple solution – append & to the command for it to detach from the terminal and run in the background. You'd have to monitor its completion using process monitoring tools like ps and may want to redirect its output to a file to watch the progress while it's still running.
php -dmemory_limit=12G bin/magento catalog:images:resize -a &
A more advanced ...
Your best option is to make use of the Linux tool "screen". You might need to install it though. It might not be part of the default Linux installation.
To start a new screen session, simply run the command: screen
Now you are able to launch any program that you want. To exit the screen session type: CRTL+A CRTL+D
This will get you back to your ...
It looks like I might be able to use nohup to do this:
Something like this:
nohup bash -c 'php -dmemory_limit=10G bin/magento catalog:images:resize -a && php -dmemory_limit=10G bin/magento queue:consumer:start media.storage.catalog.image.resize'> var/log/image-resize.txt
UPDATE: so far the commands are ...