|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
which machine
Hi,
is there any command line to see what is type of your server machine ? I mean to know if it is DELL, HP server, Fujitsu or else. Many thanks. |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
I think it might be posted in your Code:
/proc/cpuinfo if it is a linux machine. /proc based systems are present on Linux. Havnt seen them on Solaris. Not sure about other distro's. Here is a script I had to check out the Linux distro. (It might be useful.) Code:
#!/bin/sh
# Detects which OS and if it is Linux then it will detect which Linux Distribution.
OS=`uname -s`
REV=`uname -r`
MACH=`uname -m`
GetVersionFromFile()
{
VERSION=`cat $1 | tr "\n" ' ' | sed s/.*VERSION.*=\ // `
}
if [ "${OS}" = "SunOS" ] ; then
OS=Solaris
ARCH=`uname -p`
OSSTR="${OS} ${REV}(${ARCH} `uname -v`)"
elif [ "${OS}" = "AIX" ] ; then
OSSTR="${OS} `oslevel` (`oslevel -r`)"
elif [ "${OS}" = "Linux" ] ; then
KERNEL=`uname -r`
if [ -f /etc/redhat-release ] ; then
DIST='RedHat'
PSUEDONAME=`cat /etc/redhat-release | sed s/.*\(// | sed s/\)//`
REV=`cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*//`
elif [ -f /etc/SuSE-release ] ; then
DIST=`cat /etc/SuSE-release | tr "\n" ' '| sed s/VERSION.*//`
REV=`cat /etc/SuSE-release | tr "\n" ' ' | sed s/.*=\ //`
elif [ -f /etc/mandrake-release ] ; then
DIST='Mandrake'
PSUEDONAME=`cat /etc/mandrake-release | sed s/.*\(// | sed s/\)//`
REV=`cat /etc/mandrake-release | sed s/.*release\ // | sed s/\ .*//`
elif [ -f /etc/debian_version ] ; then
DIST="Debian `cat /etc/debian_version`"
REV=""
fi
if [ -f /etc/UnitedLinux-release ] ; then
DIST="${DIST}[`cat /etc/UnitedLinux-release | tr "\n" ' ' | sed s/VERSION.*//`]"
fi
OSSTR="${OS} ${DIST} ${REV}(${PSUEDONAME} ${KERNEL} ${MACH})"
fi
echo ${OSSTR}Vino |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Thank you.
|
| Sponsored Links | ||
|
![]() |
| Tags |
| linux mandrake |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to transfer files from unix machine to local machine using shell script? | vidhyaS | Shell Programming and Scripting | 1 | 08-08-2011 10:27 AM |
| shell script to copy files frm a linux machine to a windows machine using SCP | nithin6034 | Shell Programming and Scripting | 3 | 07-21-2011 12:56 AM |
| To find the LATEST file from a dir on REMOTE machine and SCP to local machine? | me_ub | Red Hat | 3 | 07-08-2009 12:57 AM |
| Best possible communication mechanism between a Solaris machine and a windows machine | Krsh | Solaris | 7 | 02-05-2009 09:41 AM |
| Link type between working machine and server machine | palash2k | UNIX for Dummies Questions & Answers | 1 | 05-22-2008 06:43 AM |
|
|