Search:  

 
 
   All ForumsHot TopicsGallery






how-to block ads


 
Forums » Tech and Talk » OS and Software » All Things Unix » Little Known Tips and Tricks...
Search Topic:
Share Topic:
RSS topic:
toggle:
flat / full
normal / watch
Posting:
Post a:
Post a:
Gaim alternatives? »
« Need Light Network Enabled Distro..  
AuthorAll Replies

paul1238

join:2000-11-03
Brookline, MA

reply to dom6791
Re: Little Known Tips and Tricks...

Great idea for a thread. I'll start it off with one

In unix, the way that an application programmer would normally query the kernel for kernel information is to use the ioctl() system call if there was not a C library call already available.

In linux, if you don't want to write a program or if you didn't have a utility already available (ie. uptime, ps, etc.) to query the kernel, there is a nice facility to access kernel information using a filesystem interface. This is the /proc interface. Most common modules in the kernel support this interface method.

For example, if you do a ls -al /proc, a lot of files are listed. Nearly all of them will have a zero byte count. But there is actually useful data in there .

cat /proc/meminfo will provide information on the kernel's view of memory.
cat /proc/cpuinfo will provide information on the kernel's view of the cpu.

Ever wonder about specific process information? In the /proc interface, a directory is created for each process id that the kernel is currently running.

ls -al /proc/1 will provide all the information that the kernel is tracking for process 1 which is always the init process. For example, if you are curious what environment variables was passed to the init process when it started, cat /proc/1/environ.

If you don't have the uname application and you want to find the kernel version, cat /proc/sys/kernel/osrelease.

The /proc interface can be a useful method to query the kernel.
Forums » Tech and Talk » OS and Software » All Things UnixGaim alternatives? »
« Need Light Network Enabled Distro..  


Thursday, 26-Nov 07:17:48 Terms of Use | Privacy Policy | Hosting by www.nac.net - DSL,Hosting & Co-lo | feedback | contact
over 10 years online! © 1999-2009 dslreports.com.
page compression OFF
Most commented news this week
· [105] New AT&T Ad Campaign Hits Back At Verizon
· [104] Time Warner Cable Fires Broadside At Broadcasters
· [95] Apple Joins AT&T Verizon Snark Fest
· [85] New Bill Takes Aim At Higher Verizon ETFs
· [63] TiVo Sees Record Customer Losses
· [48] In-Flight Internet Headed For Bumpy Landing?
· [34] Senators Want ACTA Made Public
· [32] Despite Billions In USF Fees, U.S. Libraries Lack Bandwidth
· [30] Earthlink Suffers From Major E-mail Outage
· [30] AT&T Offers New Prepaid Wireless plans
Most people now reading
· Whats the big deal about being "Old School"....? [World of Warcraft]
· Windows 7 boot manager editing questions [Microsoft Help]
· 3.x Feral Druid - Bear Tanking Guide [World of Warcraft]
· Slow speeds in the evenings [TekSavvy]
· [Config] cisco asa 5505 with multiple outside IP addresses [Cisco]
· HOW-TO: QoS and Tomato (fixes "choppy voice") [MagicJack]
· Maximizing Rogue DPS for 3.1 [World of Warcraft]
· What to use while demonoid is down? [Filesharing Software]
· Fiber to the Premises [Comcast HSI]