Introduction – Knowing bash version can help to see if the specific feature will work with your system or not. This page shows how to check or find out your bash shell version running on a *BSD, Linux, macOS, and Unix-like operating systems.
How do I find the version of bash I am running?
To find my bash version, run any one of the following command:
- Get the version of bash I am running, type: echo "${BASH_VERSION}"
- Check my bash version on Linux by running: bash --version
- To display bash shell version press Ctrl+x Ctrl+v
Check my bash version using ${BASH_VERSION} shell variable
Type echo command or printf command:
echo "BASH_VERSION" printf "%s\n" $BASH_VERSION
Find bash shell version using the --version option
Just pass the --version to the bash command to show version information for this instance of bash shell on the screen and exit successfully:
bash --version echo $?
How to check Bash version
Display version information about the current instance of bash using keyboard shortcut
Just press CTRL + x followed by CTRL + v and you should see something as follows on screen:
GNU bash, version 4.4.19(1)-release (x86_64-pc-linux-gnu)
Use package manger to find out bash version
Use the dnf command on a Fedora Linux and yum command on a CentOS/RHEL to get version info about bash package:
$ yum info bash
How to check bash version on a CentOS Linux using yum command
How to check Bash version on Debian or Ubuntu Linux
Debian/Ubuntu Linux user try the apt command or apt-cache command or dpkg command as follows:
$ apt info bash
OR
$ apt-cache show bash
How to get bash version number using a package manager
# pkg info bash
Confirmation:
ash-5.0.18_3 Name : bash Version : 5.0.18_3 Installed on : Sat Jan 2 22:50:30 2021 IST Origin : shells/bash Architecture : FreeBSD:12:amd64 Prefix : /usr/local Categories : shells Licenses : GPLv3+ Maintainer : ehaupt@FreeBSD.org WWW : https://www.gnu.org/software/bash/ Comment : GNU Project's Bourne Again SHell Options : DOCS : on FDESCFS : off HELP : on NLS : on PORTS_READLINE : on STATIC : off SYSBASHRC : off SYSLOG : off Shared Libs required: libhistory.so.8 libreadline.so.8 libintl.so.8 Annotations : FreeBSD_version: 1201000 cpe : cpe:2.3:a:gnu:bash:5.0.18:::::freebsd12:x64:3 repo_type : binary repository : FreeBSD Flat size : 8.48MiB Description : This is GNU Bash. Bash is the GNU Project's Bourne Again SHell, a complete implementation of the POSIX.2 shell spec, but also with interactive command line editing, job control on architectures that support it, csh-like features such as history substitution and brace expansion, and a slew of other features. WWW: https://www.gnu.org/software/bash/ root@nixcraft-m6700:~ #
Conclusion
This page showed you various commands on how to check bash version on your Linux or Unix-like operating system.
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
- RSS feed or Weekly email newsletter
- Share on Twitter • Facebook • 6 comments... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
Another option:
That is stupid. The -v prints shell input lines as they are read. Use the --version:
bash --version
I am using:
193286785860010052d99ef_000002
It might help someone.
It is 2014 and I just wanna say thank you for this page.
+1
Add my vote too in 2017.