This script retrieves various pieces of system information and displays them in a human-readable format. The information includes public and internal IP addresses, a censored MAC address, top CPU-consuming processes, memory usage, active system services, and the largest files in the /home directory.
- Public IP Address: Retrieves the public IP address using the
curlcommand. - Internal IP Address: Retrieves the internal IP address using the
hostnamecommand. - Censored MAC Address: Retrieves and censors the MAC address of the default network interface.
- Top CPU Processes: Displays the top 5 processes by CPU usage with formatted headers.
- Memory Usage: Displays the current memory usage in a human-readable format.
- Active System Services: Lists the active system services managed by
systemctl. - Largest Files in /home Directory: Finds and lists the top 10 largest files in the
/homedirectory.
- Save the script to a file, e.g.,
system_info.sh. - Make the script executable:
chmod +x system_info.sh
- Run the script:
./system_info.sh
The script will output the following information:
- Public IP Address: Your external IP address.
- Internal IP Address: Your internal IP address within the local network.
- Censored MAC Address: The MAC address with the first three octets censored for privacy.
- Top CPU Processes: A table of the top 5 processes by CPU usage.
- Memory Usage: Current memory usage statistics.
- Active System Services: The first 10 active system services.
- Largest Files in /home Directory: The top 10 largest files in the
/homedirectory.
The script uses the following commands:
curlhostnameipawkpsfreesystemctlfinddu
Ensure these commands are available on your system before running the script.
This README provides an overview of the script's functionality, usage instructions, example output, and other relevant information for users.
