How to Check Bash Version in Linux Operating System
In this Linux tutorial we are going to learn how to how to check bash version in Linux. To get bash version in Linux, we can use either bash command or $BASH_VERSION environment variable.
Bash version command in Linux
Easiest way to check bash version is to run bash --version in the command prompt.
The output of the command will be something similar to below.
GNU bash, version 4.3.42(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
As you can see I am using bash version 4.3.42. The bash --version command works in All Linux distributions.
We can also get the bash version in Linux from the BASH_VERSION Environment Variables.
The Output should be something similar to below.
So that is how you can check bash version in Linux Operating System.