-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ellen Spelling wrote:
| What are the 20 basic newbie Redhat Linux commands I should send to my
| users so they can identify the key particulars about any Redhat system?
|
| Here is what I've compiled so far for our very very very Sun centric crowd.
|
| Please improve for all the USENET to benefit.
|
| Ellen
|
| ************************************************** **************************
| How best to determine important stuff about a Linux machine
| ************************************************** **************************
| ----------------------------------------------------------------------------
| 0. To determine the Linux kernel:
| tcsh% cat /proc/sys/kernel/osrelease
| EXAMPLE: 2.4.21-9.ELsmp
|
| tcsh% uname -r|sed s/smp//
| EXAMPLE: 2.4.21-9.EL

Just
~ uname -r
please.

In your example, the kernel version is essentially 2.4.21 but your distro has
compiled it with EXTRAVERSION set to 9.ELsmp. If you're going to sed out the smp
part, you probably should also sed out the -9.EL part as well.

| ----------------------------------------------------------------------------
| 1. To determine the Redhat release:
| tcsh% cat /etc/redhat-release
| EXAMPLE: Red Hat Enterprise Linux WS release 3 (Taroon Update 1)
|
| Note: There must be a better way than to rely on a text file?

Nope. That's it. There's no standard way (across distributions) to indicate
which release of which distribution is installed. A text file is as good as
anything else.

| ----------------------------------------------------------------------------
| 2. To determine just the number of processors:
| tcsh% cat /proc/cpuinfo | grep "processor" | wc -l
| EXAMPLE: 4
|
| To determine the number & type of processors:
| tcsh% cat /proc/cpuinfo | egrep "processor|vendor_id|model name|cpu MHz"
| EXAMPLE: processor : 0
| vendor_id : GenuineIntel
| model name : Intel(R) Xeon(TM) CPU 3.06GHz
| cpu MHz : 3056.620
| processor : 1
| vendor_id : GenuineIntel
| model name : Intel(R) Xeon(TM) CPU 3.06GHz
| cpu MHz : 3056.620
| processor : 2
| vendor_id : GenuineIntel
| model name : Intel(R) Xeon(TM) CPU 3.06GHz
| cpu MHz : 3056.620
| processor : 3
| vendor_id : GenuineIntel
| model name : Intel(R) Xeon(TM) CPU 3.06GHz
| cpu MHz : 3056.620

OK

| ----------------------------------------------------------------------------
| 3. To determine installed RAM in megabytes:
| tcsh% free -m |grep "Mem"|awk -F: '{print $2}' |awk '{print $1" MB"}'
| EXAMPLE: 8 MB

Better would be

~ free -m | awk '$1 ~ /Mem/ { print $2 "MB" } '

which does the same thing, with one less awk , one less grep and two less pipes

| ----------------------------------------------------------------------------
| 4. To determine swap (in megabytes):
| tcsh% free -m |grep "Swap"|awk -F: '{print $2}'|awk '{print $1" MB"}'
| EXAMPLE: 24,568 MB

~ free -m | awk '$1 ~ /Swap/ { print $2 "MB" }

| ----------------------------------------------------------------------------
| 5. To determine the X Server (only works from the console):
| tcsh% /usr/X11R6/bin/XFree86 -version|grep Version |awk -F/ '{print $1}'`
| EXAMPLE: ?

/usr/X11R6/bin/XFree86 -version 2>&1 | awk '$1 ~ /XFree86/ { print $3 } '

| ----------------------------------------------------------------------------
| 6. To determine the platform type:
| tcsh% uname -m
| EXAMPLE: i686

OK

| ----------------------------------------------------------------------------
| 7. To determine the most important colormap information:
| tcsh% xdpyinfo | sed -n -e '/TrueColor/p' -e '/24 planes/p'\
| | sort -u | grep -v "window:"
| tcsh% xdpyinfo | sed -n -e '/PseudoColor/p' -e '/8 planes/p'\
| | sort -u | grep -v "window:"
|
| EXAMPLE: class: TrueColor
| depth: 24 planes
|
| class: PseudoColor
| depth: 8 planes

OK, but I'm suspicious that this could be simplified a bit.

| ----------------------------------------------------------------------------
| 8. To determine the hostname & IP address:
| tcsh% hostname -v -i
| EXAMPLE: foobar.Domain.COM foobar 111.122.100.101

Yes and no. This only works for the hostname returned by gethostname(2) (which
is the one and only value set by the sethostname(2) call). It doesn't work for
multihomed systems where each IP address has a different hostname.

| ----------------------------------------------------------------------------
| 9. To determine the hostid:
| tcsh% hostid
| EXAMPLE: 8c9ec81a

OK, but typically this isn't a very usefull value. It only reports the value set
by sethostid(2), which is a locally set value, and not something that's actually
unique by system (although it's supposed to be, and is only by dint of system
administration).


| ----------------------------------------------------------------------------
| 10. What else can & should a new Linux user run to determine key information?
| ----------------------------------------------------------------------------

Let me think about this one...

- --
Lew Pitcher

Master Codewright & JOAT-in-training | GPG public key available on request
Registered Linux User #112576 (http://counter.li.org/)
Slackware - Because I know what I'm doing.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFAa2w+agVFX4UWr64RAssqAKDX6icbIpHcFpzrotHBaA o/HtCBWgCfYSxH
B4NzuRClGIyKEqgdVsxvbrE=
=Uklm
-----END PGP SIGNATURE-----