scutil

System Configuration Utility

DESCRIPTION Invoked with no options, scutil provides a command line interface to the “dynamic store” data maintained by configd. Interaction with this data (using the SystemConfiguration.framework SCDynamicStore APIs) is handled with a set of commands read from standard input. A list of the available commands is available by entering the help directive.

Detailed DNS Information
scutil --dns

Detailed Proxy Information
scutil --proxy

Detailed Network Information
scutil --nwi

Getting the current user in macOS Bash Shell Script

loggedInUser=$( scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ && ! /loginwindow/ { print $3 }' )
Link:
https://www.oreilly.com/library/view/mac-os-x/0596006071/ch15s03.html

https://scriptingosx.com/2020/02/getting-the-current-user-in-macos-update/

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *