Command Detail - U
unalias
uname
uname -s
uname -s
in Unix, according to the man page, gives the 'kernel-version' of the OS. This is the 'top-level version' of the Unix that you're on. Typical values are 'Linux', or 'AIX' or 'HP-UX'. So, on my laptop, typing uname -s
gives:
I've only used this when writing a Unix script which have to do slightly different things on different flavours of unix.
Obviously, there's only one manufacturer for Windows software - Microsoft. So there's no direct equivalent to uname -s
. The closest equivalent on Powershell would I think be:
get-wmiobject -class win32_operatingsystem | select caption
This returns:
or
or
or
or
uname -n
According to the Linux help, uname -n does this:
So, typing uname -n gives
I haven't found a neat equivalent for this in Powershell, but this works:
The output is:
uname -r
uname -r gives the kernel release in Unix. The output varies depending on the flavour of Unix - Wikipedia has a good list of examples
On my system uname -r gives:
The best Powershell equivalent would seem to be:
...which gives:
The 7601 is Microsoft's build number.
uname -v
uname -v typically gives the date of the unix build. As far a I can think, there isn't a Powershell equivalent
uname -m
To be honest, I'm not entirely sure what uname -m shows us on Unix. The wikipedia page for uname shows various outputs none of which are hugely useful.
Running uname -m on my server gives:
Is this a PowerShell equivalent?
uptime
On most, but from memory possibly not all, flavours of *nix 'uptime' tells you how long the server has been up and running
A rough Powershell equivalent to show how long the server (or PC) has been running is:
....of course you can also do
...to get the bootup time for a remote server, or PC.
Last updated