Skip to content

Lynna Jackson

Lab/Classroom Computer and Software Managment

  • Home
  • The 100 mile view

MacOS – Script – Getting the logged in user

loggedInUser=$( scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ && ! /loginwindow/ { print $3 }' )

For more details see:
https://scriptingosx.com/2019/09/get-current-user-in-shell-scripts-on-macos/

This entry was posted in Labs and tagged Command, Macintosh, Script on September 6, 2019 by Lynna Jackson.

Post navigation

← Windows 10 – Creating Image for Windows to Go external disks MacOS – Disabling Sleep option from Finder menu →

Tags

  • Active_Directory
  • Adobe
  • AFP
  • ARD
  • Background
  • Boot
  • Bootcamp
  • Chrome
  • Command
  • Default User
  • DEP
  • Deployment
  • Dual_Boot
  • El Capitan
  • External boot
  • GIS
  • Group_Policy
  • High Sierra
  • Image
  • Installer
  • JAMF
  • KACE
  • Keyserver
  • Kiosk
  • Lion
  • Login
  • Macintosh
  • Matlab
  • Mavericks
  • Mt Lion
  • Novell
  • Packaging
  • Reference
  • Security
  • Silent Installer
  • SIP
  • Sleep
  • Software
  • Spss
  • Startup
  • User_Profile
  • VectorWorks
  • Windows
  • Windows 10
  • Windows to Go

Contact Me

Contact me by email ... [email protected]
Proudly powered by WordPress