Skip to content

Instantly share code, notes, and snippets.

@knight-of-ni
Created February 15, 2016 14:04
Show Gist options
  • Save knight-of-ni/963617fe4bd236c75769 to your computer and use it in GitHub Desktop.
Save knight-of-ni/963617fe4bd236c75769 to your computer and use it in GitHub Desktop.
perl -e 'use POSIX qw(uname); my @uname = uname(); foreach (@uname) { print $_,"\n"; }'
@knight-of-ni
Copy link
Author

Ubuntu Linux

abauer@techeng-wks01:~/dev$ ./uname.pl
Linux
techeng-wks01
4.2.0-27-generic
#32-Ubuntu SMP Fri Jan 22 04:49:08 UTC 2016

x86_64

@knight-of-ni
Copy link
Author

FreeBSD

$ perl -e 'use POSIX qw(uname); my @uname = uname(); foreach (@uname) { print $_,"\n"; }'
FreeBSD
vmfreebsd8.techengnet.local
8.3-RELEASE-p3
FreeBSD 8.3-RELEASE-p3 #0: Mon Jun 11 23:52:38 UTC 2012 [email protected]:/usr/obj/usr/src/sys/GENERIC
i386

@pliablepixels
Copy link

Mac

$ perl -e 'use POSIX qw(uname); my @uname = uname(); foreach (@uname) { print $_,"\n"; }'
Darwin
PP-MacBook-Pro.local
14.5.0
Darwin Kernel Version 14.5.0: Tue Sep 1 21:23:09 PDT 2015; root:xnu-2782.50.1~1/RELEASE_X86_64
x86_64

Supplementary data: Output of sw_vers on a mac:

$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.10.5
BuildVersion: 14F1605

@knight-of-ni
Copy link
Author

CentOS 6

[abauer@airborne24adf2 dev]$ ./uname.pl
Linux
airborne24adf2.techengnet.local
2.6.32-573.12.1.el6.x86_64
#1 SMP Tue Dec 15 21:19:08 UTC 2015

x86_64

@knight-of-ni
Copy link
Author

OmniOS/SunOS

abauer@vOmniOS:/home/abauer$ perl -e 'use POSIX qw(uname); my @uname = uname();
foreach (@uname) { print $_,"\n"; }'
SunOS
vOmniOS
5.11
omnios-f090f73
i86pc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment