Skip to content

Instantly share code, notes, and snippets.

@umi-uyura
Created April 29, 2016 14:41
Show Gist options
  • Save umi-uyura/4b215ab821186419b6c5543406993755 to your computer and use it in GitHub Desktop.
Save umi-uyura/4b215ab821186419b6c5543406993755 to your computer and use it in GitHub Desktop.
To display the computer name of the Mac
#!/bin/sh
computer_name=$(scutil --get ComputerName)
local_host_name=$(scutil --get LocalHostName)
host_name=$(scutil --get HostName)
echo "Computer Name : $computer_name"
echo "Local Host Name : $local_host_name"
echo "Host Name : $host_name"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment