How to get Mac Computer Name using Terminal


If you want to know the Computer Name of your Mac (Macbook/iMac/Mac Studio) you can make use of the scutil - the interactive access to the dynamic store for macOS.

scutil --get ComputerName

Code2care's MacBook Pro

As you can see, we made use of the --get option followed by ComputerName.

Get Computer Name using Mac Terminal


If you want to change the name of your Mac using Terminal, you can make use of the --set option along with scutil.

scutil --set ComputerName "Alan's Macbook Pro"

Note: You will be prompted to provide the password or Touch ID to apply the new name.

Facing issues? Have Questions? Post them here! I am happy to answer!

Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail: rakesh@code2care.org

Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap