X
Collapse
-
How to Check Bash Version
Checking the bash version helps Linux users in many cases, including troubleshooting and finding the currently available version in the system. If you are a regular bash user, it is good to check the bash version and keep it up to date as per the latest updates available. However, if you are a newbie in bash scripting, then you probably have never encountered a situation where you need to check the bash version.
So, in this guide, we will explain the simplest way to check the bash version in Linux. There are several ways you can easily check the bash version in your Linux system. Here, we will use multiple commands to learn the bash version of Ubuntu.
The Simple Approach
The following command is the easiest way to know the bash version:
bash --version
From the above result, you can see the current bash version of the system is 5.2.21(1).
Built in $BASH_VERSION variable
Another method to check the bash’s version is to enter the content of the bash shell’s variable as follows:
echo $BASH_VERSION
The Shell Script
It is also possible to check the bash version through a shell script. First, create a new shell script using the nano command, create a new bash file named check-bash-version.sh, and make it executable using the chmod command:
nano ~/check-bash-version.sh
chmod +x check-bash-version.sh
Next, add the following lines to your script:
#!/bin/bash echo
"Checking the bash version...."
echo "The Bash version is $BASH_VERSION !"
Now, check the bash version by running the script as follows:
./check-bash-version.sh
Using the Shortcut Key
Meanwhile, you can use the shortcut key ‘ Ctrl+X followed by ‘Ctrl+V’, and you may see the bash version on your screen as seen in the below image:
From the Package Manager
Through the package manager, you can simply run a single command to view the bash version.
yum info bash (for CentOS/RHEL)
pkg info bash (for FreeBSD)
apk info bash (for Alpine Linux)
apt info bash (for Ubuntu)
Conclusion
So, this is how you can check the bash version through multiple approaches. If you are a new user and are not able to understand the CLI approaches, then we recommend that you use the shortcut keys to check the bash version. Moreover, you can also use the commands, but make sure to avoid typos, or else you may encounter errors while using them.
More...Tags: None
Posting comments is disabled.
Categories
Collapse
Article Tags
Collapse
There are no tags yet.
Latest Articles
Collapse
-
by Kasimba
by George Whittaker
Introduction
In the digital age, securing files and controlling access to them is paramount. File permissions play a crucial role in maintaining the integrity and confidentiality of data. This article delves into the intricacies of file permissions, ownership, and access control, providing a guide to understanding and managing these aspects effectively.
In today's interconnected...-
Channel: Articles
Yesterday, 05:41 PM -
-
by Kasimba
by George Whittaker
In the world of Linux system administration, managing disk usage effectively is crucial to ensuring a stable and efficient environment. One powerful tool for this purpose is the implementation of disk quotas, which helps administrators control the amount of disk space and number of inodes that individual users or groups can use. This article delves into the intricacies of Linux disk quotas, explaining...-
Channel: Articles
05-15-2024, 03:32 PM -
-
by KasimbaIn this article, I will show you how to create a Fedora 40 virtual machine on Proxmox VE.
This article is the foundation of the Proxmox VE Fedora 40 virtual machine GPU passthrough guide. Once you have a Fedora 40 virtual machine set up, you can passthrough a GPU (i.e. NVIDIA GPU) to the Fedora 40 Proxmox VE virtual machine and do amazing things on the virtual machine.
Table of Contents
...-
Channel: Articles
05-14-2024, 09:14 PM -
-
by KasimbaIf you passthrough an NVIDIA GPU to a Fedora 40 Proxmox VE virtual machine, you get many benefits, such as:
- Stream the virtual machine’s display directly on the monitor connected to the NVIDIA GPU.
- Add a USB keyboard and a mouse to the virtual machine and use it like a real desktop computer.
- Get near-native 3D performance on the virtual machine.
In this article, I will show you how to passthrough an NVIDIA GPU to a Fedora 40 Proxmox VE virtual machine and use the virtual machine just...-
Channel: Articles
05-14-2024, 09:14 PM -
by KasimbaSAVE UP TO 50% TODAY *Offer ends May 21, 2024 Learn More at Linux Foundation Training
The post Further Your Education with Courses & Certifications appeared first on Linux.com.
More...-
Channel: Articles
05-14-2024, 12:25 PM -
-
by KasimbaNautilus file manager can share directories/folders of your Ubuntu 24.04 LTS system that you can access from Windows, MacOS, and other Linux devices.
You may not find the file-sharing option in the context menu of the Nautilus file manager in a new Ubuntu 24.04 LTS installation. That’s because the Nautilus file-sharing option is not enabled by default.
In this article, I will show you how to enable the Nautilus Samba/CIFS file-sharing option...-
Channel: Articles
05-13-2024, 03:46 AM -