commands detail - u

    1. Linux

    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:

    1. caption
    2. Microsoft Windows 7 Professional

    or

    1. Microsoft Windows 8.1 Pro

    or

    1. Microsoft(R) Windows(R) Server 2003, Standard Edition

    or

    According to the Linux help, uname -n does this:

    1. -n, --nodename
    2. print the network node hostname

    So, typing uname -n gives

    1. $ uname -n
    2. nancy.one2one.co.uk

    I haven’t found a neat equivalent for this in Powershell, but this works:

    1. get-wmiobject -class win32_computersystem | select dnshostname, domain

    The output is:

    1. dnshostname domain
    2. nancy one2one.co.uk

    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:

    1. 6.1.7601

    The 7601 is Microsoft’s build number.

    uname -v typically gives the date of the unix build. As far a I can think, there isn’t a Powershell equivalent

    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:

    1. x86_64

    Is this a PowerShell equivalent?

    1. $ get-ciminstance -class cim_computersystem | select SystemType
    2. SystemType
    3. ----------
    4. x64-based PC

    On most, but from memory possibly not all, flavours of *nix ‘uptime’ tells you how long the server has been up and running

    1. $ uptime
    2. 15:54:24 up 9 days, 5:43, 2 users, load average: 0.10, 0.09, 0.07

    A rough Powershell equivalent to show how long the server (or PC) has been running is:

      …to get the bootup time for a remote server, or PC.