How to find your computers device name using a macOS Terminal command


In this video, we’ll explore a macOS terminal command that’ll help us discover our computer’s unique name. This Computer Name is like a special label that helps us find our devices on a network. Knowing your computer’s name can be super helpful when you’re troubleshooting networking issues.

Note: On macOS you can also find or change your computer name from within System Preferences. This is done by selecting System Preferences – Sharing – Computer Name

  • From your macOS desktop, select Spotlight Search.
  • Within Spotlight Search type Terminal and press Enter on your keyboard
  • Now at the command prompt type.

Note: You may need to use the sudo command to elevate permissions. This is in order to run the scutil command.

 sudo scutil --get localHostName
  • When you press Enter on the keyboard you will be presented with the computer name of your computer.
  • As this command is difficult to remember, the following will also work
hostname
  • To gracefully close your current Terminal session type:
exit

When you press Enter on your keyboard the Terminal session will end and you can close the Terminal application.

Add comment

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

Our site members

Thank you

Support This Site

If you enjoy our content but don't want to be a site member. Please consider supporting us on Ko-fi to keep us ads free. Thanks for all your support