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

paul123

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..  


Friday, 10-Oct 15:43:47 Terms of Use | Privacy Policy | Hosting by www.nac.net - DSL,Hosting & Co-lo | feedback | contact
over 9 years online! © 1999-2008 dslreports.com.
page compression OFF
Most commented news this week
· [139] It's Cable TV Rate Hike Season
· [95] Wholesale Bandwidth Prices Still Dropping
· [95] Is Comcast Cooking Up a 22Mbps/5Mbps Tier?
· [94] Symmetrical FiOS No Longer Qualifies For Bundle Discounts
· [77] Half Of New iPhone Owners Came From Verizon
· [77] Time Warner's Ugly Feud With LIN TV
· [70] Supreme Court TiVo/Echostar Ruling
· [70] Microsoft: U.S. Broadband Policy 'Total Failure'
· [66] Verizon Unveils Blackberry Storm
· [64] XOHM Online In Additional Launch Markets
Most people now reading
· [Connectivity] Neighbor using MY router to connect to Internet? [Comcast HSI]
· WOW CEO forces employees to listen to pro-Obama speach today [Rants, Raves, & Praise]
· IMG 1.6 Build 06.89 Released [Verizon FIOS TV]
· Extreme HD and Essentials [Verizon FIOS TV]
· DSL vs Cable [General Questions]
· Fox News HD is on in MA [Verizon FIOS TV]
· Upgrades [TekSavvy]
· ADSL/ADSL2+ Speeds VS Distance [TekSavvy]
· Where did the money go? [General Questions]
·