29

General Computer information

Posted in System by whiteside 341 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;` 
sw_vers
echo "LAN IP Address: " `ifconfig en0 | grep "inet" | grep -v 127.0.0.1 | grep -v inet6 | awk '{print $2}'`
echo "Wireless IP Address: " `ifconfig en1 | grep "inet" | grep -v 127.0.0.1 | grep -v inet6 | awk '{print $2}'`

Comments

Log in to comment or register here.