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, 10-Dec 19:17:41 Terms of Use | Privacy Policy | Hosting by www.nac.net - DSL,Hosting & Co-lo | feedback | contact
over 10 years online! © 1999-2009 dslreports.com.republican-creole
page compression OFF
Most commented news this week
· [200] Sprint Sued For Distracted Driving Death
· [135] AT&T Launching New 24 Mbps U-Verse Tier
· [87] AT&T Hints At Usage-Based iPhone Data Pricing
· [82] 3G Network Test Says AT&T Is Tops
· [72] Mediacom Unveils 105 Mbps Pricing
· [72] WPA Cracker: Test WPA-PSK Networks In 20 Minutes
· [66] Sprint Poised For A Turnaround?
· [54] Average American Consumes 34 Gigabytes Daily
· [51] The Future Of Wi-Fi Is Bright
· [50] Sprint, T-Mobile Merger Rumor Lives
Most people now reading
· [WIN7] Well, I was dumb, but do I have recourse? [Microsoft Help]
· New Mediacom Email [Mediacom]
· malware has been found hidden inside an Ubuntu screensaver [Security]
· IMG 1.7 (IMG Updates and Discussion) [Verizon FIOS TV]
· Connecting to Google Voice Via SIP [VOIP Tech Chat]
· Internet access from TV [Verizon FIOS TV]
· It's happening again [AT&T Southwest]
· [How to] Install Asterisk on an Asus WL-520GU router [VOIP Tech Chat]
· 60GB would only last us two days! [TekSavvy]
· Windows 7 boot manager editing questions [Microsoft Help]