cancel
Showing results for 
Search instead for 
Did you mean: 

Scripting for linux command

 
seenivasan
Frequent Advisor

Scripting for linux command

Dear,
i have some commands to excute.

for these commands how to create the scripts

Verify server hardware:

# grep processor /proc/cpuinfo | wc -l
# grep MemTotal /proc/meminfo
# fdisk -l
# free –t -m
# ethtool

Verify Refsystem version:

# cat /etc/redhat-release

Regards,
Seenivasan P
2 REPLIES
Tim Nelson
Honored Contributor

Re: Scripting for linux command

#!/bin/bash


grep processor /proc/cpuinfo | wc -l
grep MemTotal /proc/meminfo
fdisk -l
free â t -m
ethtool
cat /etc/redhat-release


#(not sure what more you are looking for)



Mel Burslan
Honored Contributor

Re: Scripting for linux command


MYSCRIPT=$HOME/syscheck.sh
echo "#!/bin/bash" > $MYSCRIPT

echo "grep processor /proc/cpuinfo | wc -l" > $MYSCRIPT
echo "grep MemTotal /proc/meminfo" > $MYSCRIPT
echo "fdisk -l" > $MYSCRIPT
echo "free â t -m" > $MYSCRIPT
echo "ethtool" > $MYSCRIPT
echo "cat /etc/redhat-release" > $MYSCRIPT

chmod 700 $MYSCRIPT

at this point, your script is ready under your home directory. Simply run it by issuing this command

$HOME/syscheck.sh

Hope this helps
________________________________
UNIX because I majored in cryptology...