EVOLUTION-MANAGER
Edit File: Sys.info.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Extract System and User Information</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for Sys.info {base}"><tr><td>Sys.info {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Extract System and User Information</h2> <h3>Description</h3> <p>Reports system and user information. </p> <h3>Usage</h3> <pre> Sys.info() </pre> <h3>Details</h3> <p>This uses POSIX or Windows system calls. Note that OS names might not be what you expect: for example macOS identifies itself as <span class="samp">Darwin</span> and Solaris as <span class="samp">SunOS</span>. </p> <p><code>Sys.info()</code> returns details of the platform <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> is running on, whereas <code><a href="Version.html">R.version</a></code> gives details of the platform <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> was built on: the <code>release</code> and <code>version</code> may well be different. </p> <h3>Value</h3> <p>A character vector with fields </p> <table summary="R valueblock"> <tr valign="top"><td><code>sysname</code></td> <td> <p>The operating system name.</p> </td></tr> <tr valign="top"><td><code>release</code></td> <td> <p>The OS release.</p> </td></tr> <tr valign="top"><td><code>version</code></td> <td> <p>The OS version.</p> </td></tr> <tr valign="top"><td><code>nodename</code></td> <td> <p>A name by which the machine is known on the network (if any).</p> </td></tr> <tr valign="top"><td><code>machine</code></td> <td> <p>A concise description of the hardware, often the CPU type.</p> </td></tr> <tr valign="top"><td><code>login</code></td> <td> <p>The user's login name, or <code>"unknown"</code> if it cannot be ascertained.</p> </td></tr> <tr valign="top"><td><code>user</code></td> <td> <p>The name of the real user ID, or <code>"unknown"</code> if it cannot be ascertained.</p> </td></tr> <tr valign="top"><td><code>effective_user</code></td> <td> <p>The name of the effective user ID, or <code>"unknown"</code> if it cannot be ascertained. This may differ from the real user in ‘set-user-ID’ processes.</p> </td></tr> </table> <p>The first five fields come from the <code>uname(2)</code> system call. The login name comes from <code>getlogin(2)</code>, and the user names from <code>getpwuid(getuid())</code> and <code>getpwuid(geteuid())</code> </p> <h3>Note</h3> <p>The meaning of <code>release</code> and <code>version</code> is system-dependent: on a Unix-alike they normally refer to the kernel. There, usually <code>release</code> contains a numeric version and <code>version</code> gives additional information. Examples for <code>release</code>: </p> <pre> "4.17.11-200.fc28.x86_64" # Linux (Fedora) "3.16.0-5-amd64" # Linux (Debian) "17.7.0" # macOS 10.13.6 "5.11" # Solaris </pre> <p>There is no guarantee that the node or login or user names will be what you might reasonably expect. (In particular on some Linux distributions the login name is unknown from sessions with re-directed inputs.) </p> <p>The use of alternatives such as <code>system("whoami")</code> is not portable: the POSIX command <code>system("id")</code> is much more portable on Unix-alikes, provided only the POSIX options <span class="option">-[Ggu][nr]</span> are used (and not the many BSD and GNU extensions). <code>whoami</code> is equivalent to <code>id -un</code> (on Solaris, <code>/usr/xpg4/bin/id -un</code>). </p> <h3>See Also</h3> <p><code><a href="Platform.html">.Platform</a></code>, and <code><a href="Version.html">R.version</a></code>. <code><a href="../../utils/html/sessionInfo.html">sessionInfo</a>()</code> gives a synopsis of both your system and the <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> session (and gives the OS version in a human-readable form). </p> <h3>Examples</h3> <pre> Sys.info() ## An alternative (and probably better) way to get the login name on Unix Sys.getenv("LOGNAME") </pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>