To know the version of bash that is available on your device make use of --version option along with the bash.
Example:$ bash --version
GNU bash, version 3.2.57(1)-release (arm64-apple-darwin21)
Copyright (C) 2007 Free Software Foundation, Inc.
You do not need to be on the bash shell in order to know the version, in the below example the same command works on the zsh or sh shell as well.
% bash --version
GNU bash, version 3.2.57(1)-release (arm64-apple-darwin21)
Copyright (C) 2007 Free Software Foundation, Inc.
% sh
sh-3.2$ bash --version
GNU bash, version 3.2.57(1)-release (arm64-apple-darwin21)
Copyright (C) 2007 Free Software Foundation, Inc.
sh-3.2$
You would get a command not found error if you use single dash with version option!
$ -version
-version
bash: -version: command not found
More Posts related to Bash,
- How to start or open a new bourne-again shell (bash) session on Windows using Command Line CMD
- How to create new user account in Windows bash
- Bash Hello World! Script Tutorial
- How to Compare Strings in Bash
- How to see Created Accessed Modified and Changed dates of a file using bash terminal command
- Command to Sort File In Reverse Order [Unix/Linux/macOS]
- Bash command to wait for seconds
- [fix] bash: ssh: command not found
- bash: netstat: command not found
- Know Bash shell version command
- List all Username and User ID using Bash Command
- How to use Autocomplete and Autosuggestion in Shell Commands
- How to know the current shell you are logged in?
- [Fix] bash: script.sh: /bin/bash^M: bad interpreter: No such file or directory
- 'pwd' is not recognized as an internal or external command, operable program or batch file. [Windows]
- How to Kill a port using bash terminal command?
- How to fix bash ping command not found error
- Install Bash Completion on macOS
- bash get year 2021 calendar
- How to check your IP using bash for Windows?
- Bash For Loop Example
- Fix bash: script.sh: Permission denied Error
More Posts:
- Android : Duplicate registration for activity com.example.abc - Android
- How to Open Finder using Mac Terminal - MacOS
- Must Know Homebrew Commands for Mac/Linux Users - MacOS
- Display Era details (AD BC) in Java Date using SimpleDateFormat - Java
- How to remove blank lines from a file using Notepad++ - NotepadPlusPlus
- 0xCAA20003: You ran into an authorization problem. [Microsoft] - Microsoft
- What is Microsoft 365 Message You are using more licenses on your trial than what you will purchase once the free trial ends. - Microsoft
- Java SE JDBC Select Statement Example - Java