General Computer information

Posted in System by whiteside 3043 days ago

Displays General information about the machine

  • computer name
  • current login user
  • memory of the machine
  • processor type
  • product name "Mac OS X"
  • product version "10.6.4
  • Buildversion
  • lan ip address
  • wireless ip address

Not that tidy code wise but works! any comments welcome

echo "Workstation Name: " `scutil --get ComputerName;`
echo "UserName: " `whoami`
echo "Memory: " `sw_vers | awk -F':t' '{print $2}' | paste -d ' ' - - -; 
sysctl -n hw.memsize | awk '{print $0/1073741824" GB RAM"}';` 
echo "Architecture: " `sysctl -n machdep.cpu.brand_string;` 
echo "LAN IP Address: " `ifconfig en0 | grep "inet" | grep -v | grep -v inet6 | awk '{print $2}'`
echo "Wireless IP Address: " `ifconfig en1 | grep "inet" | grep -v | grep -v inet6 | awk '{print $2}'`


User Avatar
Bouffski 3023 days ago
Thanx for this!

User Avatar
sunglassesmichael 2904 days ago
Can you tell me why my IP is showing up as a LAN IP when I am connected to a Wireless network and no wireless IP is showing?
User Avatar
alexwasserman 2754 days ago
@sunglassesmichael - he's assuming your two network devices are ethernet first, then wireless.

If you switch en0 and en1 in the ifconfig lines above you'll sort them out.

Log in to comment or register here.