1

How to find unix/linux system info like OS version, RAM, no. of processors, hard disk, memory dedicated to a particular process, memory utilization of java using java or shell scripts.

0

2 Answers 2

1

To find the version of the kernel, use uname -r in a shell script. All kinds of information regarding the hardware can be retrieved from the files in /proc.

/proc/cpuinfo contains information about the CPU's, including their number. /proc/meminfo shows the total physical memory, free memory, etc.

If you only want to fetch a particular field, you can filter the output like this:

cat /proc/cpuinfo | grep "model name"

df shows you all of the mounted storage devices and their used space.

/proc/PID/status shows the amount of virtual memory dedicated to the process, where PID is the numeric process id.

Sign up to request clarification or add additional context in comments.

Comments

0

Have a look at sysinfo.sh for a starter - it's easy to extend with your own modules.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.