20 basic Linux newbie commands to identify the system

From: Ellen Spelling (spellinellen_at_yahoo.com)
Date: 03/31/04


Date: 31 Mar 2004 13:29:23 -0800

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
----------------------------------------------------------------------------
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?
----------------------------------------------------------------------------
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
----------------------------------------------------------------------------
3. To determine installed RAM in megabytes:
    tcsh% free -m |grep "Mem"|awk -F: '{print $2}' |awk '{print $1" MB"}'
          EXAMPLE: 8 MB
----------------------------------------------------------------------------
4. To determine swap (in megabytes):
    tcsh% free -m |grep "Swap"|awk -F: '{print $2}'|awk '{print $1" MB"}'
          EXAMPLE: 24,568 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: ?
----------------------------------------------------------------------------
6. To determine the platform type:
    tcsh% uname -m
          EXAMPLE: i686
----------------------------------------------------------------------------
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
----------------------------------------------------------------------------
8. To determine the hostname & IP address:
    tcsh% hostname -v -i
          EXAMPLE: foobar.Domain.COM foobar 111.122.100.101
----------------------------------------------------------------------------
9. To determine the hostid:
    tcsh% hostid
          EXAMPLE: 8c9ec81a
----------------------------------------------------------------------------
10. What else can & should a new Linux user run to determine key information?
----------------------------------------------------------------------------