Click to See Complete Forum and Search --> : Handy bash commands for finding out stuff in Linux


fancypiper
02-10-2003, 03:39 PM
# 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.

Icarus
02-10-2003, 03:45 PM
Or run GKrellm and over half of these will be displayed at all times :D

fancypiper
02-10-2003, 03:52 PM
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.. :rolleyes:

:rolleyes: Moderators! :rolleyes:

:D

wapcaplet
02-10-2003, 04:10 PM
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 :)

fancypiper
02-10-2003, 04:31 PM
Good one. Possibly better if piped to less

du | less

or re-directed to a file

du > diskusage

Icarus
02-11-2003, 12:14 PM
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.. :rolleyes:

:rolleyes: Moderators! :rolleyes:

:D Someone looking for a banning?:D

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.

TheCatMan
02-11-2003, 12:29 PM
Yep Mandy does use bash.

Two of my faves:

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

ps -A
to see what's running

valetudo
02-11-2003, 12:39 PM
Very good threed here helpfull for newbs like me, keep em coming.

hlrguy
02-11-2003, 12:53 PM
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

threadhead
02-12-2003, 02:42 PM
you are starting a pretty similar thread to this one.

;)

http://www.justlinux.com/forum/showthread.php?s=&threadid=72069

fancypiper
02-12-2003, 03:11 PM
Originally posted by mahdi
Someone looking for a banning?:D:D If banning Linux idiots is the policy, so be it! :pGKrellm 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 :cool: moderator :cool:had a minor mental slip and did not mention the command line options or the config file needed for those nice features. :pdid 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????? :confused: :confused: ;)

threadhead
02-12-2003, 04:14 PM
Originally posted by fancypiper
Even though threadhead thinks it's too much like insert tip here????? :confused: :confused: ;)

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)
:D

cya

fancypiper
02-12-2003, 04:41 PM
Thread? Is someone sewing something? :confused:

klick0x
02-20-2003, 12:46 PM
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.