Introduction
In this project, you will learn how to retrieve and display system information on a Linux server. The getinfo.sh
script you will create can be used to quickly gather important details about the server's hardware, software, and network configuration.
ð Preview
$ sh getinfo.sh
## Example
cpu num: 8
memory total: 30 G
memory free: 10867 M
disk size: 20G
system bit: 64
process: 40
software num: 1389
ip: 1.32.X.X
ðŊ Tasks
In this project, you will learn:
- How to retrieve the number of CPUs, total memory, available memory, disk size, system bit, number of running processes, number of installed software packages, and IP address of the server.
- How to use various Linux commands and tools, such as
grep
,free
,df
,getconf
,ps
,dpkg-query
, andip
, to gather system information. - How to write a zsh script that combines these commands to provide a comprehensive overview of the server's state.
ð Achievements
After completing this project, you will be able to:
- Understand how to use shell scripting to automate the collection of system information.
- Gain familiarity with commonly used Linux commands and their applications.
- Create a reusable script that can be executed to quickly retrieve and display important server details.
- Apply your newfound knowledge to monitor and troubleshoot Linux systems more effectively.