Write a shell script to show various system configurations likea) your OS and version, release number, kernel versionb) all available shellsc) computer CPU information like processor type, speed etcd) memory informatione) hard disk information like size of hard-disk, cache memory, model etcf) File system (Mounted)
Question
Write a shell script to show various system configurations likea) your OS and version, release number, kernel versionb) all available shellsc) computer CPU information like processor type, speed etcd) memory informatione) hard disk information like size of hard-disk, cache memory, model etcf) File system (Mounted)
Solution
Sure, here is a simple bash shell script that will display the system configurations you mentioned:
#!/bin/bash
# a) OS and version, release number, kernel version
echo "OS and version, release number, kernel version:"
uname -a
echo ""
# b) All available shells
echo "All available shells:"
cat /etc/shells
echo ""
# c) Computer CPU information like processor type, speed etc
echo "Computer CPU information:"
lscpu
echo ""
# d) Memory information
echo "Memory information:"
free -h
echo ""
# e) Hard disk information like size of hard-disk, cache memory, model etc
echo "Hard disk information:"
lsblk
sudo hdparm -I /dev/sda
echo ""
# f) File system (Mounted)
echo "File system (Mounted):"
df -h
Please note that this script should be run with root privileges to access all the information. Also, replace /dev/sda with your actual hard disk device name if it's not sda.
To run the script, save it to a file, give it execute permissions with chmod +x filename, and then run it with ./filename.
Similar Questions
What command can we use to retrieve information about the windows system we are using?
Total computer system consists of;Hardware, Software, Liveware, FirmwareInput, Output, Storage devicesHardware, Software, Storage devicesHardware, Software, Lifeware, FirmwareFirmware, Liveware, Hardware, Software
Which module provides information about the operating system?fshttposurlPreviousSave & Next
Elaborate on the operating system structure
Explain computer functionality• Explain CPU architecture.• Describe RAID.• Describe common ports, cables, and connectors.• Describe monitor characteristics
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.