{base}R Documentation

Extract System and User Information


Reports system and user information.



This function is not implemented on all R platforms, and returns NULL when not available. Where possible it is based on POSIX system calls. (Under Windows, it is obtained by Windows system calls and the last three values are the same.) returns details of the platform R is running on, whereas R.version gives details of the platform R was built on: the release and version may well be different.

Note that OS names might not be what you expect: for example OS X identifies itself as Darwin and Solaris as SunOS.


A character vector with fields


The operating system name.


The OS release.


The OS version.


A name by which the machine is known on the network (if any).


A concise description of the hardware, often the CPU type.


The user's login name, or "unknown" if it cannot be ascertained.


The name of the real user ID, or "unknown" if it cannot be ascertained.


The name of the effective user ID, or "unknown" if it cannot be ascertained. This may differ from the real user in ‘set-user-ID’ processes.

The first five fields come from the uname(2) system call. The login name comes from getlogin(2), and the user names from getpwuid(getuid()) and getpwuid(geteuid())


The meaning of OS ‘release’ and ‘version’ is system-dependent and 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.)

The use of alternatives such as system("whoami") is not portable: the POSIX command system("id") is much more portable on Unix-alikes, provided only the POSIX options are used (and not the many BSD and GNU extensions).

See Also

.Platform, and R.version. sessionInfo() gives a synopsis of both your system and the R session.

## An alternative (and probably better) way to get the login name on Unix

[Package base version 3.3.0 Index]