How to open applications in fullscreen via Terminal
How can I keep Terminal in foreground while the other apps are being open?


Use the -g or --background flag to open:


 -g  Do not bring the application to the foreground.



for example:

open -g -a Notes

will open Notes.app in the background.

Unfortunately not all apps appear to respect this. For those apps you may need to hide them manually using AppleScript:

osascript -e 'tell application "System Events" to set visible of process "FOO" to false'

where FOO is the name of the app.

p.s. - instead of $(whoami) you can use $LOGNAME