Mac Terminal view is Screen Sharing is Enabled
You can do so by checking for the existence of the launchd files in /etc:

[[ -f /etc/RemoteManagement.launchd ]] &amp;&amp; echo 'enabled' || echo 'disabled'


or for screen sharing:

[[ -f /etc/com.apple.screensharing.agent.launchd ]] &amp;&amp; echo 'enabled' || echo 'disabled'