-
Notifications
You must be signed in to change notification settings - Fork 3
redhat
ghdrako edited this page Apr 15, 2024
·
5 revisions
- https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9
- https://www.cyberciti.biz/faq/how-do-i-determine-rhel-version/
# redhat version
cat /etc/redhat-release
less /etc/os-release
less /etc/system-release-cpe
more /etc/issue
hostnamectl
rpm --query redhat-release-server
lsb_release -d
lsb_release -a
# kernel version
cat /proc/version
uname -a
uname -mrs
grep VERSION_ID /etc/os-release
ver=$(grep '^VERSION_ID' /etc/os-release | awk -F'=' '{ print $2}')
echo "$ver"
# replace double quotes #
ver=$(grep '^VERSION_ID' /etc/os-release | awk -F'=' ' gsub(/"/,"") { print $2}')
echo "$ver"
# We can use awk and avoid grep completely #
# 1. Search for VERSION_ID in /etc/os-release
# 2. Use '=' as a field seprator
# 3. Remove double quote
# 4. Print version number
# 5. Store the version number in $rhel_ver shell variable
rhel_ver=$(awk -F'=' '/VERSION_ID/{ gsub(/"/,""); print $2}' /etc/os-release)
echo "$rhel_ver"
/etc/pki/ca-trust/source/anchors
Test