Handy bash commands for finding out stuff in Linux


Results 1 to 14 of 14

Thread: Handy bash commands for finding out stuff in Linux

Hybrid View

  1. #1
    Join Date
    Jul 1999
    Posts
    4,031

    Handy bash commands for finding out stuff in Linux

    # Find CPU specifications
    cat /proc/cpuinfo
    # What pci cards are installed and what irq/port is used
    cat /proc/pci
    # Memory information
    free
    # How is the hard drive partitioned
    fdisk /dev/hdXX -l
    # How much free drive space
    df -h
    # Find running kernel version
    uname -r
    # Find X server version
    X -showconfig
    # What is the distribution
    cat /etc/.product
    cat /etc/.issue
    cat /etc/issue
    cat /etc/issue.net
    sysinfo
    # For finding or locating files
    find
    locate
    which
    whereis
    Look at man <command> or info <command> for the flags and options you can use for bash commands.

    What have I overlooked? Add your essential informational bash commands/scripts.

  2. #2
    Join Date
    Aug 2001
    Location
    Somewhere, Texas
    Posts
    9,627
    Or run GKrellm and over half of these will be displayed at all times

  3. #3
    Join Date
    Jul 1999
    Posts
    4,031
    But gkrellm displays a graphical representation without a lot of specifics.

    Then there is gtop, ktop, etc.

    I was specific about the command line in the subject as all distros (Mandrake users, double check me) use bash..

    Moderators!


  4. #4
    Join Date
    Aug 2002
    Location
    Bowling Green, OH
    Posts
    352
    du

    (show disk usage by current directory and all subdirectories) is one of my favorites. Handy for figuring out if it's time to make a backup CD yet

  5. #5
    Join Date
    Jul 1999
    Posts
    4,031
    Good one. Possibly better if piped to less

    du | less

    or re-directed to a file

    du > diskusage

  6. #6
    Join Date
    Aug 2001
    Location
    Somewhere, Texas
    Posts
    9,627
    Originally posted by fancypiper
    But gkrellm displays a graphical representation without a lot of specifics.

    Then there is gtop, ktop, etc.

    I was specific about the command line in the subject as all distros (Mandrake users, double check me) use bash..

    Moderators!

    Someone looking for a banning?

    GKrellm isn't just a graphical tool...you can configure it to show you the hard numbers also. It's just an option, did I sound negetive at all? I don't think so, There are lots of good suggestions in this thread and the more the better. I use GKrellm for a general view. If I need more detail these are the commands to use.

  7. #7
    Join Date
    Jul 2001
    Location
    UK
    Posts
    316

    Cool

    Yep Mandy does use bash.

    Two of my faves:

    dmesg|less
    to find out what went wrong at boot-up

    ps -A
    to see what's running
    We are free to think. We are free to plan. And we are free to do. But once an action has been taken, we are never free from its consequences.
    --Russel M. Nelson, apostle.

  8. #8
    Join Date
    Feb 2003
    Posts
    41
    Very good threed here helpfull for newbs like me, keep em coming.

  9. #9
    Join Date
    Sep 2002
    Location
    San Antonio, TX
    Posts
    2,607
    1) Find a process id by name
    ps -ef |grep -i <plain text>

    For example, XCDroast

    ps -ef |grep -i xcdroast /* Case Insensitive */

    2) See current environment list, or pipe to file
    env |more
    env > environmentvariablelist.txt

    3) Show current userid and assigned groups

    id

    4) Scan for problems with system, executing a file, etc

    tail -f /var/log/message

    5) See all command aliases for the current user
    alias

    6) rpms installed on current system
    rpmquery --all |more
    rpmquery --all > filenameyouwouldlike.txt
    rpmquery --all | grep -i <plaintext> /* find specific rpms with name in them */

    hlrguy
    Were you a Windows expert the VERY first time you looked at a computer with Windows, or did it take a little time.....
    My Linux Blog
    Linux Native Replacements for Windows Programs
    Mandriva One on a "Vista Home Barely" T3640 E-Machine runs great.

  10. #10
    Join Date
    Aug 2002
    Location
    europe
    Posts
    520
    you are starting a pretty similar thread to this one.



    http://www.justlinux.com/forum/showt...threadid=72069

  11. #11
    Join Date
    Jul 1999
    Posts
    4,031
    Originally posted by mahdi
    Someone looking for a banning?
    If banning Linux idiots is the policy, so be it!
    GKrellm isn't just a graphical tool...you can configure it to show you the hard numbers also. It's just an option,
    Hmm. I did not know that. I just use it as a small monitor to check cpu and modem. I guess I'll have to read the man page since the nice, kind moderator had a minor mental slip and did not mention the command line options or the config file needed for those nice features.
    did I sound negetive at all?
    Not really, I just thought you needed some knocking around just to see if you respond like mdwatts.
    I don't think so, There are lots of good suggestions in this thread and the more the better. I use GKrellm for a general view. If I need more detail these are the commands to use.
    Even though threadhead thinks it's too much like insert tip here?????
    Last edited by fancypiper; 02-12-2003 at 03:18 PM.

  12. #12
    Join Date
    Aug 2002
    Location
    europe
    Posts
    520
    Originally posted by fancypiper
    Even though threadhead thinks it's too much like insert tip here?????
    i dont think its too much, i even appreciate it very much!
    but you could easily add all these tips into the BIG thread.
    (i hope you know which one i mean)


    cya

  13. #13
    Join Date
    Jul 1999
    Posts
    4,031

  14. #14
    Join Date
    Feb 2003
    Location
    Canada
    Posts
    14
    I found these pretty cool.

    top -q -d 2 , shows top resource hoggers, refreshes every 2 seconds. top -n 1 -b > <filename> (pipes all enviroment variables to filename.

    set | less , shows all enviroment variables associated with a process.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •