> For the complete documentation index, see [llms.txt](https://chloe-codes1.gitbook.io/til/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://chloe-codes1.gitbook.io/til/linux/linux-101/ways_to_check_linux_os_version_in_command_line.md).

# Ways to Check Linux OS Version in Command Line

> Looked it up out of curiosity

\ <br>

### Checking Linux Kernel version

: The Linux Kernel version is managed in `/proc/version`

```bash
$ cat /proc/version
Linux version 3.10.0-957.21.3.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) ) #1 SMP Tue Jun 18 16:35:19 UTC 2019
```

<br>

#### Checking the current kernel version

* Use the `-a` option for detailed information

```bash
$ uname -r
3.10.0-957.21.3.el7.x86_64

$ uname -a
Linux 3.10.0-957.21.3.el7.x86_64 #1 SMP Tue Jun 18 16:35:19 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

```

\ <br>

### Checking Linux Distro version

: The method for checking the distro version differs for each distro

<br>

#### CentOS / RedHat Enterprise

```bash
# cat /etc/redhat-release
CentOS release 6.3 (Final)
```

<br>

#### Ubuntu

```bash
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04 LTS"
```

<br>

#### Debian

```bash
$ cat /etc/debian_version
4.0
```

<br>

#### Fedora

```bash
cat /etc/fedora-release
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://chloe-codes1.gitbook.io/til/linux/linux-101/ways_to_check_linux_os_version_in_command_line.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
