Often times I will ssh into a new client's box to make changes to their website configuration without knowing much about the server configuration. I have seen a few ways to get information about the system you're using, but are there some standard commands to tell me what version of Unix/Linux I'm on and basic system information (like if it is a 64-bit system or not), and that sort of thing?

Basically, if you just logged into a box and didn't know anything about it, what things would you check out and what commands would you use to do it?


13 Answers 13


If I need to know what it is say Linux/Unix , 32/64 bit

uname -a 

This would give me almost all information that I need,

If I further need to know what release it is say (Centos 5.4, or 5.5 or 5.6) on a Linux box I would further check the file /etc/issue to see its release info ( or for Debian / Ubuntu /etc/lsb-release )

Alternative way is to use the lsb_release utility:

lsb_release -a

Or do a rpm -qa | grep centos-release or redhat-release for RHEL derived systems

  • 4
    In 2016 it does not seem like lsb_release works any longer with modern distros. I tested the command on Amazon Linux AMI release 2016.03 and CentOS Linux 7 and it was not found. It seems like ls cat /etc/os-release is the best solution currently with uname -a somewhat usable if a bit opaque (e.g. Amazon Linux AMI release 2016.03 vs. Linux ip-x-x-x-x 4.4.11-23.53.amzn1.x86_64 #1 SMP Wed Jun 1 22:22:50 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux)
    – runamok
    Sep 19, 2016 at 19:00
  • Well Done (y) :)
    – Sam
    Jun 9, 2017 at 12:10

Use the following commands to get more details:

  1. cat /etc/*release*
  2. uname -a
  • 5
    i like this answer better than the accepted one
    – Randy L
    Sep 22, 2017 at 17:08
  • 1
    Add cat /proc/version and it covers every release I've found over the years. I've never seen a case where /proc/version wasn't helpful, but I've seen cases where one or both of the above don't help (can't remember which but most likely embedded systems.) Feb 25, 2020 at 15:13

Use cat /proc/version


Linux version 3.14.27-100.fc19.x86_64 (mockbuild@bkernel02.phx2.fedoraproject.org) (gcc version 4.8.3 20140911 (Red Hat 4.8.3-7) (GCC) ) #1 SMP Wed Dec 17 19:36:34 UTC 2014

I believe this works for most distros, and provides a more concise answer than cat /etc/*release* and more complete answer than uname -a. However, use of /proc for things other than processes is now eschewed, so maybe it'll disappear someday.

  • 1
    This worked for me
    – tinonetic
    Apr 1, 2018 at 19:50
  • 2
    On Apline 3.10.4 this returned something unexpected: Linux version 4.19.76-linuxkit (root@d203b39a3d78) (gcc version 8.3.0 (Alpine 8.3.0)) #1 SMP Thu Oct 17 19:31:58 UTC 2019
    – b01
    Feb 24, 2020 at 12:24
  • @b01 Thanks for the input. At least it got the Alpine part correct. ;-) Where did 3.10.4 come from, uname -a? It's sad that there is no single correct answer! Feb 25, 2020 at 15:08
  • I learned this while writing a tool that did a survey of connected systems which were embedded Linux running on various brands and models of storage servers. It was the only command I found that returned something useful in every case, and since then I've never seen it not be useful, even on BusyBox-based distros. Feb 25, 2020 at 15:20
  • 1
    @JeffLearman I was using a Go Lang Alpine Docker image of 1.13-alpine-3.10 and wanted to know the bug release number. I ended up trying quite a few of these answers to see which worked and not.
    – b01
    Feb 26, 2020 at 18:50

There are a ton of answers but I'm looking for more generic. AFAI am concerned the following works on most of systems.

cat /etc/os-release

Example output:

sh-4.4$ cat /etc/os-release                                                                                                                                                                           
VERSION="26 (Twenty Six)"                                                                                                                                                                             
PRETTY_NAME="Fedora 26 (Twenty Six)"                                                                                                                                                                  
  • 3
    This will work on Linux distros that use systemd. For older versions of those distros that don't use systemd, this won't work (e.g. RHEL 6), and for distros that don't use systemd at all this won't work. The second most voted answer will cat this file anyway, so there's no reason not to prefer that more general command.
    – Wildcard
    Aug 19, 2019 at 23:48

You should look into the uname command.

I have to deal with a large parc of heterogenous machines. uname -a is usually my first reflex when I log in.


For the Alpine distribution:

cat /etc/alpine-release

To combine some ideas here:

cat /etc/*_version /etc/*-release && uname -a

Should get you want you need on any distribution.

  • To those who are searching for which version is alpine running inside docker, this command works and produces following output: cat: can't open '/etc/*_version': No such file or directory 3.14.2 NAME="Alpine Linux" ID=alpine VERSION_ID=3.14.2 PRETTY_NAME="Alpine Linux v3.14" HOME_URL="https://alpinelinux.org/" BUG_REPORT_URL="https://bugs.alpinelinux.org/" Oct 24, 2021 at 13:10

Type in the command line:

uname -a

That'll give you all the information you seek.

Try also:

man uname to restrict the information


inxi is a System Information Tool for Linux. It displays handy information concerning system hardware (hard disk, sound cards, graphic card, network cards, CPU, RAM, and more), together with system information about drivers, Xorg, desktop environment, kernel, GCC version(s), processes, uptime, memory, and a wide array of other useful information.

If inxi is not installed in your system, you can install it by:

$ sudo apt install inxi       [On Debian/Ubuntu/Linux Mint]
$ sudo yum install inxi       [On CentOs/RHEL/Fedora]
$ sudo dnf install inxi       [On Fedora 22+]

In manpage you can fine that -S option can be used to get host name, kernel, desktop environment (if in X/Wayland), distro.

% inxi -S
System:    Host: blueray-i5 Kernel: 5.4.0-53-generic x86_64 bits: 64 Desktop: Cinnamon 4.6.7 Distro: Linux Mint 20 Ulyana

This can be used as a debugging, and/or forum technical support tool. So you might consider keeping it in your toolbelt.


Centos 5 using file in /etc/redhat-release


whatami by Remy Evard at Argonne National Lab. Install and run using these commands:

$ wget https://raw.githubusercontent.com/open-mpi/mtt/master/client/whatami/whatami && chmod a+x whatami
Resolving raw.githubusercontent.com...
Connecting to raw.githubusercontent.com||:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 24434 (24K) [text/plain]
Saving to: 'whatami'

whatami                                           100%[============================================================================================================>]  23.86K  --.-KB/s    in 0.02s   

2018-08-15 18:54:42 (1.49 MB/s) - 'whatami' saved [24434/24434]

$ ./whatami
  • 1
    You might want to link to that tool or explain how you installed it, it's not on by default.
    – slm
    Aug 14, 2018 at 16:12

A problem I found with the practical uname-a is that, in microsoft's wsl, it always returns something like (even inside docker containers!):

Linux d0b341b1f694 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 Linux

On the other hand, when using cat /etc/os-release (or cat /etc/*release*), also in wsl, it returns the correct system of the container (or of the linux distro).


For CentOs

$ cat /etc/centos-release
SHMZ release 6.6 (Final)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.