I use scp to copy files from a remote (Linux) computer to my local machine (Mac OS Mojave). I have "Remote Login" enabled on my Mac. In the "Sharing" section of System Preferences, where I enabled "Remote Login," an address is listed, which, when I'm on UCLA's campus for example, looks like this:
This address (numbers x'ed and name removed) allows me to
ssh into my Mac from the foreign computer and in particular to use
scp to transfer files.
On the foreign machine, I use
scp filename email@example.com:~/Downloads
and the file appears in my Mac's Downloads folder.
I would like to automate this process. The remote address seems to change frequently. How do I obtain my computer's address from the command line? Mac OS can clearly generate it, as it lists it in System Preferences.