How do I find the version of bash I am running?
Solution 1:
The -v
parameter for bash stands for verbose, and instructs bash to print out as much information as possible about what it is doing. On startup, it will print out all the configuration it is reading in.
To print out the version information for bash, use bash --version
.
Solution 2:
When running bash (e.g. from gnome-terminal
) you can check value of BASH_VERSION
environment variable.
$ echo $BASH_VERSION
4.2.37(1)-release
If the value is empty, you are not running bash
.
Solution 3:
There's a key shortcut that instructs current shell information to show up:
Ctrl+x Ctrl+v
From man bash
display-shell-version (C-x C-v)
Display version information about the current instance of bash.
This is the best choice if you have messed with environment variables.
Solution 4:
No, everything is alright. From man bash
:
--verbose
Equivalent to -v.
It is just not as silent as usual. Try
--version
instead.
Solution 5:
The usual --version
may give you too much multi-line boilerplate so what I am using is
bash -c 'echo $BASH_VERSION'