<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7517427329637873814</id><updated>2011-07-08T05:31:19.287-07:00</updated><category term='linux'/><category term='Mac OS X'/><category term='php'/><title type='text'>collection of computer articles</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://fahadnct.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://fahadnct.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>fahad syamlan</name><uri>http://www.blogger.com/profile/06708957413852542769</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7517427329637873814.post-6914634830470297076</id><published>2010-03-04T23:34:00.000-08:00</published><updated>2010-03-05T00:10:04.250-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>Configure the CakePHP debug output setting</title><content type='html'>&lt;p&gt;CakePHP configure tip: If you're a &lt;a href="http://cakephp.org/"&gt;CakePHP&lt;/a&gt; newbie, one of the surprising things about seeing your first CakePHP view pages is seeing the &lt;em&gt;CakePHP debug&lt;/em&gt; output (the SQL debug output) at the bottom of your view pages. It's definitely a nice feature for when you're learning CakePHP, and also for any time you're trying to understand what queries CakePHP is running for you, but it's a surprise at first.&lt;/p&gt; &lt;p&gt;This nice CakePHP &lt;em&gt;debug output&lt;/em&gt; feature also leads to a CakePHP FAQ: How do I turn off (configure) the CakePHP SQL debug output at the bottom of my view pages?&lt;/p&gt; &lt;h2&gt;How to configure the CakePHP debug output&lt;/h2&gt; &lt;p&gt;To configure the CakePHP SQL debug output, just open the &lt;code&gt;$app/config/core.php&lt;/code&gt; file, and look for the &lt;code&gt;debug&lt;/code&gt; parameter. In CakePHP version 1.2.5 the line you're looking for looks something like this:&lt;/p&gt; &lt;pre&gt;Configure::write('debug', 2);&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;By default, this 'debug' parameter is set to a value of &lt;code&gt;2&lt;/code&gt;, which is one of the CakePHP development mode options.&lt;/p&gt; &lt;p&gt;CakePHP currently supports four debug mode settings, which you control by setting this CakePHP debug parameter to a value of 0-3. Here's how the CakePHP core.php configuration file describes these four levels:&lt;/p&gt; &lt;pre&gt;/**&lt;br /&gt;* CakePHP Debug Level:&lt;br /&gt;*&lt;br /&gt;* Production Mode:&lt;br /&gt;* 0: No error messages, errors, or warnings shown. Flash messages redirect.&lt;br /&gt;*&lt;br /&gt;* Development Mode:&lt;br /&gt;* 1: Errors and warnings shown, model caches refreshed, flash messages halted.&lt;br /&gt;* 2: As in 1, but also with full debug messages and SQL output.&lt;br /&gt;* 3: As in 2, but also with full controller dump.&lt;br /&gt;*&lt;br /&gt;* In production mode, flash messages redirect after a time interval.&lt;br /&gt;* In development mode, you need to click the flash message to continue.&lt;br /&gt;*/&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;As you can see from those docs, when your application goes into production mode, you'll want to set this CakePHP debug parameter to &lt;code&gt;0&lt;/code&gt;, like this:&lt;/p&gt; // set the cakephp debug level to production mode Configure::write('debug', 0);  &lt;p&gt;Note: In CakePHP version 1.2.5, which I'm currently using, this CakePHP debug parameter is set to &lt;code&gt;2&lt;/code&gt; by default.&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7517427329637873814-6914634830470297076?l=fahadnct.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fahadnct.blogspot.com/feeds/6914634830470297076/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://fahadnct.blogspot.com/2010/03/configure-cakephp-debug-output-setting.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/6914634830470297076'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/6914634830470297076'/><link rel='alternate' type='text/html' href='http://fahadnct.blogspot.com/2010/03/configure-cakephp-debug-output-setting.html' title='Configure the CakePHP debug output setting'/><author><name>fahad syamlan</name><uri>http://www.blogger.com/profile/06708957413852542769</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7517427329637873814.post-7066468411017880842</id><published>2010-03-04T23:21:00.000-08:00</published><updated>2010-03-04T23:33:33.774-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>Comments in PHP - PHP comment syntax and examples</title><content type='html'>&lt;p&gt;It's funny, when I first started working with PHP, the only thing I wanted to know is "What syntax do I use for comments in PHP?" (It reminds me of learning to ride a motorcycle, where the first thing you need to learn is how to stop.)&lt;/p&gt; &lt;p&gt;Fortunately, if you have a Unix/Linux and/or C programming background, the &lt;em&gt;PHP comment&lt;/em&gt; syntax will seem very familiar, and I'll share some simple PHP comment examples here.&lt;/p&gt; &lt;h2&gt;PHP comments with # or //&lt;/h2&gt; &lt;p&gt;You can create one-line comments in PHP using either the standard &lt;code&gt;#&lt;/code&gt; or &lt;code&gt;//&lt;/code&gt; comment characters, as shown in this example:&lt;/p&gt; &lt;pre&gt;# this is a one line php comment&lt;br /&gt;&lt;br /&gt;// this is also a one-line comment in php&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;You can create PHP comments by starting a line with these comment symbols, and just like Linux shell programming and several other programming languages, you can also use these same comment symbols to put comments at the end of any valid PHP statement. Here's a quick example of how to do that:&lt;/p&gt; &lt;pre&gt;$foo = 1;  // this is a php comment&lt;br /&gt;$bar = 2;  #  another php comment&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;h2&gt;Multiline PHP comments&lt;/h2&gt; &lt;p&gt;You can also create multiline comments in PHP using the following comment syntax, which again you may have seen in many other programming languages:&lt;/p&gt; /*  * this is a php comment  */  &lt;p&gt;I often use this comment syntax above my PHP functions, like this:&lt;/p&gt; /*  * this function does yada yada yada.  * it's very good, and has no known bugs.  */ function do_something () {   // my code here }  &lt;p&gt;I hope these simple examples of comments in PHP are helpful.&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7517427329637873814-7066468411017880842?l=fahadnct.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fahadnct.blogspot.com/feeds/7066468411017880842/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://fahadnct.blogspot.com/2010/03/comments-in-php-php-comment-syntax-and.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/7066468411017880842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/7066468411017880842'/><link rel='alternate' type='text/html' href='http://fahadnct.blogspot.com/2010/03/comments-in-php-php-comment-syntax-and.html' title='Comments in PHP - PHP comment syntax and examples'/><author><name>fahad syamlan</name><uri>http://www.blogger.com/profile/06708957413852542769</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7517427329637873814.post-8747689355027608095</id><published>2010-03-04T23:15:00.000-08:00</published><updated>2010-03-04T23:21:51.112-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>CakePHP, PHP, and LAMP developer jobs</title><content type='html'>&lt;p&gt;Having learned a lot about &lt;a href="http://php.net/"&gt;PHP&lt;/a&gt; and &lt;a href="http://cakephp.org/"&gt;CakePHP&lt;/a&gt; lately, I was wondering what the job market looks like for &lt;em&gt;CakePHP developers&lt;/em&gt; these days, so I've been poking around various websites lately to see what's going on.&lt;/p&gt;  &lt;p&gt;Careerbuilder.com shows a few jobs for CakePHP developers, with salaries in the wide range of $50K to $100K per year. Digging into the descriptions, some of those jobs are actually for &lt;em&gt;Rails developers&lt;/em&gt;, &lt;em&gt;PHP developers&lt;/em&gt;, and &lt;em&gt;LAMP developers&lt;/em&gt;.&lt;/p&gt; &lt;p&gt;The crazy thing is that when you google "cakephp developer" or "cakephp developers", there are tons of ads for people that will develop code for $10/hour, or even less. I don't know anything about their quality, but wow, that's dirt-cheap for a programming salary/rate. (*shudders*)&lt;/p&gt;&lt;h2&gt;CakePHP and Drupal jobs&lt;/h2&gt; &lt;p&gt;Fooling around again this morning, and I just found the back door into the dice.com website. I've always thought of DICE as a contract programming shop, so I thought I'd see what they had to offer. I searched for the following PHP job descriptions, with the following results:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;CakePHP - 18 job postings&lt;/li&gt;&lt;li&gt;Drupal - 132 job postings&lt;/li&gt;&lt;li&gt;LAMP PHP - 334 job postings&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;That's pretty much along the lines of what I expected. The more general the search, the more results, and CakePHP being the least-commonly used PHP technology I've learned lately. Not that it's the least-commonly used PHP framework; just the least-known framework I have personally learned lately. I like CakePHP a lot, and I don't want that to come across the wrong way at all.&lt;/p&gt;&lt;h2&gt;More CakePHP jobs (careerbuilder)&lt;/h2&gt; &lt;p&gt;For the record, I just did the same search at careerbuilder.com, and found the following similar results:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;CakePHP - 8 job postings&lt;/li&gt;&lt;li&gt;Drupal - 63 job postings&lt;/li&gt;&lt;li&gt;LAMP PHP - 160 job postings&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;(As I've come back to edit this article, I've seen that Dice.com regularly has more developer jobs listed than careerbuilder, though Dice is more of a contract programming shop.)&lt;/p&gt; &lt;h2&gt;CakePHP jobs&lt;/h2&gt; &lt;p&gt;Poking around a little more, I just found this link for &lt;a href="http://cakephp.org/jobs"&gt;CakePHP jobs&lt;/a&gt; on the CakePHP website. That's a nice service for CakePHP developers, and a great way to promote the CakePHP framework.&lt;/p&gt; &lt;h2&gt;Drupal jobs&lt;/h2&gt; &lt;p&gt;Okay, more searching, and more results. Here's a similar link to &lt;a href="http://groups.drupal.org/jobs"&gt;Drupal jobs&lt;/a&gt; on the Drupal.org website. Again, a great service for Drupal developers.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7517427329637873814-8747689355027608095?l=fahadnct.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fahadnct.blogspot.com/feeds/8747689355027608095/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://fahadnct.blogspot.com/2010/03/cakephp-php-and-lamp-developer-jobs.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/8747689355027608095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/8747689355027608095'/><link rel='alternate' type='text/html' href='http://fahadnct.blogspot.com/2010/03/cakephp-php-and-lamp-developer-jobs.html' title='CakePHP, PHP, and LAMP developer jobs'/><author><name>fahad syamlan</name><uri>http://www.blogger.com/profile/06708957413852542769</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7517427329637873814.post-1882180374186029184</id><published>2010-03-02T05:20:00.000-08:00</published><updated>2010-03-04T23:15:56.962-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Mac OS X'/><title type='text'>A simple Mac Meditation application</title><content type='html'>&lt;p&gt;Today I'm releasing Version 1.0 of a very simple, free Mac OS X application named "Meditation".&lt;/p&gt; &lt;p&gt;This Mac Meditation application is really just a very simple timer that plays a "gong" sound at the end of the time period you specify. (So, if you want a Mac OS X timer application for some other reason, Meditation may fit your needs.)&lt;/p&gt; &lt;h2&gt;Mac Meditation information&lt;/h2&gt; &lt;p&gt;This application is written in Java, but I've turned it into a Mac application, as described in this "Make your Java app look like a Mac OS X app" tutorial.&lt;/p&gt; &lt;p&gt;As a consumer, if you have Mac OS X 10.5 ("Leopard") or newer, this should work fine. I don't have older versions of Mac OS X (like "Tiger"), so I don't know if it will work on those systems or not.&lt;/p&gt; &lt;p&gt;Here's what the Meditation application looks like when it's running:&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_HQp2LN0-ECo/S40Q1_zppHI/AAAAAAAAAAk/dC_FcdRCLts/s1600-h/mac-osx-meditation-app.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 160px;" src="http://4.bp.blogspot.com/_HQp2LN0-ECo/S40Q1_zppHI/AAAAAAAAAAk/dC_FcdRCLts/s320/mac-osx-meditation-app.png" alt="" id="BLOGGER_PHOTO_ID_5444026044407981170" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Again, it's very simple. Just enter the desired number of minutes to meditate, and the "gong" sound will play twice at the end of that time period.&lt;/p&gt; &lt;h2&gt;Download Meditation&lt;/h2&gt; &lt;p&gt;As mentioned, the Mac Meditation is free. You can download it as a zip file by clicking the link below:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;a href="http://www.devdaily.com/apple/mac/meditation/DD-Meditation.zip"&gt;Click here to download the Mac OS X Meditation app&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Here's the MD5 checksum for this zip file:&lt;/p&gt; &lt;pre&gt;a98d16c162996f50374f0d354023b535&lt;br /&gt;&lt;/pre&gt; &lt;h2&gt;Installing the Mac Meditation app&lt;/h2&gt; &lt;p&gt;Once you've downloaded the Meditation application, double-click the zip file to open the contents, check out the README and LICENSE files, and then install it like most other Mac applications: Just drag it to your Applications folder.&lt;/p&gt; &lt;p&gt;If you have any questions or problems, just leave a comment below, or use the contact form to reach me.&lt;/p&gt; &lt;p&gt;Namaste :)&lt;br /&gt;Al&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7517427329637873814-1882180374186029184?l=fahadnct.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fahadnct.blogspot.com/feeds/1882180374186029184/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://fahadnct.blogspot.com/2010/03/simple-mac-meditation-application.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/1882180374186029184'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/1882180374186029184'/><link rel='alternate' type='text/html' href='http://fahadnct.blogspot.com/2010/03/simple-mac-meditation-application.html' title='A simple Mac Meditation application'/><author><name>fahad syamlan</name><uri>http://www.blogger.com/profile/06708957413852542769</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_HQp2LN0-ECo/S40Q1_zppHI/AAAAAAAAAAk/dC_FcdRCLts/s72-c/mac-osx-meditation-app.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7517427329637873814.post-5023177697533587406</id><published>2010-03-02T05:16:00.000-08:00</published><updated>2010-03-02T05:17:52.962-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Mac OS X'/><title type='text'>Debug Mac OS X network/internet issues with lsof</title><content type='html'>&lt;p&gt;A lot of times when I'm asked to debug a Unix, Linux, or Mac OS X system, I'll hear a complaint like "The network seems slow", or just "It seems slow", followed by the usual "What is it doing?"&lt;/p&gt; &lt;p&gt;I actually think that last question is a wonderful one: What &lt;em&gt;is&lt;/em&gt; this computer doing? You can see a lot of information about Unix processes using the ps command or the top utility, but it seems like many system administrators don't know how to find networking information, at least not without a network sniffer.&lt;/p&gt; &lt;p&gt;On a Mac OS X system you can find out what servers your Mac is connected to, what ports are in use, and what processes (or applications) are accessing the internet. In this Mac OS X networking tutorial I'll demonstrate how to use the &lt;em&gt;Unix/Linux lsof command&lt;/em&gt; on a Mac OS X system to see very cool and helpful network-related information.&lt;/p&gt; &lt;h2&gt;Use lsof for detailed network information&lt;/h2&gt; &lt;p&gt;If you haven't used it before, "lsof" stands for "list open files", and while I normally use it to list the files opened by a particular user or process, it can be used to get great networking information as well.&lt;/p&gt; &lt;p&gt;Diving right in, I now use the Unix/Linux lsof command to find out what ports are in use on a Mac OS X system, as well as which applications are accessing which servers on the internet.&lt;/p&gt; &lt;p&gt;The basic lsof command I use is shown here:&lt;/p&gt; &lt;pre&gt;sudo lsof -i -P&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;Typically I start with this command, and then use other versions of this command if I need other information. Here's some abbreviated, sample networking output from this lsof command:&lt;/p&gt; &lt;pre&gt;$ sudo lsof -i -P&lt;br /&gt;&lt;br /&gt;COMMAND     PID           USER   FD   TYPE    DEVICE SIZE/OFF   NODE NAME&lt;br /&gt;launchd       1           root   13u  IPv6 0x3cefbe8      0t0    TCP localhost:631 (LISTEN)&lt;br /&gt;launchd       1           root   14u  IPv4 0x4020e64      0t0    TCP host2.foo.com:631 (LISTEN)&lt;br /&gt;ntpd         15           root   20u  IPv4 0x3ceba38      0t0    UDP *:123&lt;br /&gt;ntpd         15           root   21u  IPv6 0x3ceb6d8      0t0    UDP *:123&lt;br /&gt;ntpd         15           root   22u  IPv6 0x3ceccc8      0t0    UDP localhost:123&lt;br /&gt;ntpd         15           root   23u  IPv4 0x3cecbf0      0t0    UDP host2.foo.com:123&lt;br /&gt;ntpd         15           root   24u  IPv6 0x3cecb18      0t0    UDP localhost:123&lt;br /&gt;ntpd         15           root   25u  IPv6 0x3cebb10      0t0    UDP Macintosh-2.local:123&lt;br /&gt;ntpd         15           root   26u  IPv4 0x3ceb378      0t0    UDP 192.168.1.101:123&lt;br /&gt;ntpd         15           root   27u  IPv6 0x3cec6e0      0t0    UDP Macintosh-2.local:123&lt;br /&gt;mDNSRespo    25 _mdnsresponder    7u  IPv4 0x3ceca40      0t0    UDP *:5353&lt;br /&gt;mDNSRespo    25 _mdnsresponder    8u  IPv6 0x3cec890      0t0    UDP *:5353&lt;br /&gt;mDNSRespo    25 _mdnsresponder    9u  IPv4 0x3ce9368      0t0    UDP *:59492&lt;br /&gt;mDNSRespo    25 _mdnsresponder   11u  IPv4 0x3cea0e8      0t0    UDP *:65456&lt;br /&gt;mDNSRespo    25 _mdnsresponder   12u  IPv4 0x3ce9878      0t0    UDP *:59834&lt;br /&gt;mDNSRespo    25 _mdnsresponder   13u  IPv4 0x3cea7a8      0t0    UDP *:65080&lt;br /&gt;mDNSRespo    25 _mdnsresponder   14u  IPv4 0x3ce9950      0t0    UDP *:59946&lt;br /&gt;mDNSRespo    25 _mdnsresponder   15u  IPv4 0x3cea880      0t0    UDP *:56912&lt;br /&gt;configd      38           root    9u  IPv4 0x3cecda0      0t0    UDP *:*&lt;br /&gt;configd      38           root   12u  IPv6 0x4641da0      0t0 ICMPV6 *:*&lt;br /&gt;configd      38           root   13u  IPv6 0x4641e78      0t0 ICMPV6 *:*&lt;br /&gt;blued        50           root    3u  IPv4 0x3cec380      0t0    UDP *:*&lt;br /&gt;prl_dhcpd    72           root    4u  IPv4 0x3cec020      0t0    UDP *:*&lt;br /&gt;SystemUIS   118             al    9u  IPv4 0x3ceb7b0      0t0    UDP *:*&lt;br /&gt;iTunes      175             al   21u  IPv4 0x61e6270      0t0    TCP *:3689 (LISTEN)&lt;br /&gt;iTunes      175             al   22u  IPv6 0x3cef984      0t0    TCP *:3689 (LISTEN)&lt;br /&gt;ping       4488             al    3u  IPv4 0x4641cc8      0t0   ICMP *:*&lt;br /&gt;firefox-b  9764             al   30u  IPv4 0x3f9366c      0t0    TCP 192.168.1.101:63639-&gt;iw-in-f138.1e100.net:80 (ESTABLISHED)&lt;br /&gt;firefox-b  9764             al  106u  IPv6 0x3cef4bc      0t0    TCP localhost:58884-&gt;localhost:58883 (TIME_WAIT)&lt;br /&gt;eclipse   11384             al   19u  IPv6 0x3cef258      0t0    TCP *:59291 (LISTEN)&lt;br /&gt;eclipse   11384             al   20u  IPv6 0x3cee664      0t0    TCP localhost:58727-&gt;localhost:58726 (TIME_WAIT)&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;As you can see, this basic command is very nice because it shows the name of the application (the COMMAND column), the process id (PID), user, protocol (TCP, UDP, ICMP), and port and server information. If you've used the Mac OS X netstat command before, you know this is much more information than you can get from netstat.&lt;/p&gt; &lt;h2&gt;lsof options&lt;/h2&gt; &lt;p&gt;Here's a quick look at the lsof command options I used in that command:&lt;/p&gt; &lt;pre&gt;-i  list all internet files&lt;br /&gt;-P  inhibits conversion of port numbers to port names&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;As mentioned, I mostly just use those two options, but here is a list of other lsof command arguments you can use related to networking:&lt;/p&gt; &lt;pre&gt;-n  inhibits conversion of network numbers to host names (makes lsof faster)&lt;br /&gt;-N  information about NFS files&lt;br /&gt;-R  show the parent process id (PPID)&lt;br /&gt;-T  (there are many, many TCP options available; too many to list here)&lt;br /&gt;-U  Unix domain socket files&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;In a network debugging application I'm currently writing, I also use the -n option shown here. I've read that this is a good idea when you don't know if there is a network problem, such as a DNS problem, that might cause this command to significantly slow down.&lt;/p&gt; &lt;p&gt;Next, I'll show a few lsof command options that I also use to debug Mac networking issues.&lt;/p&gt; &lt;h2&gt;Show only TCP (or UDP, ICMP)&lt;/h2&gt; &lt;p&gt;To show only TCP connections run an lsof command like this:&lt;/p&gt; &lt;pre&gt;lsof -i TCP&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;Similarly, to see all UDP ports, use this command:&lt;/p&gt; &lt;pre&gt;lsof -i UDP&lt;br /&gt;&lt;/pre&gt; &lt;h2&gt;Ports in a LISTEN state&lt;/h2&gt; &lt;p&gt;To see ports in a LISTEN state, use one of the previous commands, and simply grep for LISTEN:&lt;/p&gt; &lt;pre&gt;sudo lsof -i -P | grep LISTEN&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;Or, to look for records in a state of LISTEN, ESTABLISHED, CLOSED, or WAIT, pipe the output into egrep, like this:&lt;/p&gt; &lt;pre&gt;sudo lsof -i -P | egrep 'LISTEN|ESTABLISHED|CLOSED|WAIT'&lt;br /&gt;&lt;/pre&gt; &lt;h2&gt;lsof versus netstat&lt;/h2&gt; &lt;p&gt;I think lsof gives you much more information than you can get with the current Mac OS X version of the &lt;code&gt;netstat&lt;/code&gt; command. For instance, here's the output from a netstat command where I try to look at TCP information:&lt;/p&gt; &lt;pre&gt;$ netstat -p TCP -a&lt;br /&gt;&lt;br /&gt;Active Internet connections (including servers)&lt;br /&gt;Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)&lt;br /&gt;tcp4       0      0  *.59291                *.*                    LISTEN&lt;br /&gt;tcp6       0      0  *.daap                 *.*                    LISTEN&lt;br /&gt;tcp4       0      0  *.daap                 *.*                    LISTEN&lt;br /&gt;tcp4       0      0  host2.foo.com.ipp      *.*                    LISTEN&lt;br /&gt;tcp6       0      0  localhost.ipp          *.*                    LISTEN&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;Personally I think this netstat output isn't very useful, and I much prefer the lsof command information that gives you the name of the process, the PID, PPID, and much more.&lt;/p&gt;&lt;h2&gt;Other useful lsof commands&lt;/h2&gt; &lt;p&gt;Before going, although the following lsof commands aren't directly related to Mac OS X networks, ports, sockets, or the internet, they are very useful whenever you need to know what files are in use by a particular user or application (process).&lt;/p&gt; &lt;p&gt;To see the files opened by a user named alvin, use this command:&lt;/p&gt; &lt;pre&gt;lsof -u alvin&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;To see the files opened by a particular process (such as the "firefox" process shown above), give the lsof command the PID (process ID), like this:&lt;/p&gt; &lt;pre&gt;lsof -p 9764&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;(I promise, you'll be amazed at the files an application like Firefox keeps open at any one time. It currently has a reference to every image file on my Mac Desktop, which strikes me as pretty crazy.)&lt;/p&gt; &lt;h2&gt;Internet domain socket states (states you see with lsof or netstat)&lt;/h2&gt; &lt;p&gt;As a final note, when debugging OS X network ports, internet connections, etc., it really helps to understand the different states a socket can be in. Here's a list of the possible socket states, courtesy of the netstat man command:&lt;/p&gt; &lt;pre&gt;CLOSED:       The socket is not in use.&lt;br /&gt;&lt;br /&gt;LISTEN:       The socket is listening for incoming connections. Unconnected&lt;br /&gt;             listening sockets like these are only displayed when using the -a option.&lt;br /&gt;&lt;br /&gt;SYN_SENT:     The socket is actively trying to establish a connection to a&lt;br /&gt;             remote peer.&lt;br /&gt;&lt;br /&gt;SYN_RCVD:     The socket has passively received a connection request from a&lt;br /&gt;             remote peer.&lt;br /&gt;&lt;br /&gt;ESTABLISHED:  The socket has an established connection between a local&lt;br /&gt;             application and a remote peer.&lt;br /&gt;&lt;br /&gt;CLOSE_WAIT:   The socket connection has been closed by the remote peer,&lt;br /&gt;             and the system is waiting for the local application to close&lt;br /&gt;             its half of the connection.&lt;br /&gt;&lt;br /&gt;LAST_ACK:     The socket connection has been closed by the remote peer, the&lt;br /&gt;             local application has closed its half of the connection, and the system&lt;br /&gt;             is waiting for the remote peer to acknowledge the close.&lt;br /&gt;&lt;br /&gt;FIN_WAIT_1:   The socket connection has been closed by the local&lt;br /&gt;             application, the remote peer has not yet acknowledged the close, and the&lt;br /&gt;             system is waiting for it to close its half of the connection.&lt;br /&gt;&lt;br /&gt;FIN_WAIT_2:   The socket connection has been closed by the local&lt;br /&gt;             application, the remote peer has acknowledged the close, and the system&lt;br /&gt;             is waiting for it to close its half of the connection.&lt;br /&gt;&lt;br /&gt;CLOSING:      The socket connection has been closed by the local application&lt;br /&gt;             and the remote peer simultaneously, and the remote peer has not yet&lt;br /&gt;             acknowledged the close attempt of the local application.&lt;br /&gt;&lt;br /&gt;TIME_WAIT:    The socket connection has been closed by the local&lt;br /&gt;             application, the remote peer has closed its half of the connection, and&lt;br /&gt;             the system is waiting to be sure that the remote peer received the last&lt;br /&gt;             acknowledgement.&lt;br /&gt;&lt;/pre&gt;&lt;h2&gt;More networking, port, and socket information&lt;/h2&gt; &lt;p&gt;I really don't want to oversimplify this networking/port/internet/security topic, so until I can take more time to break it down, I strongly encourage you to read the man pages for the netstat and lsof commands.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7517427329637873814-5023177697533587406?l=fahadnct.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fahadnct.blogspot.com/feeds/5023177697533587406/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://fahadnct.blogspot.com/2010/03/debug-mac-os-x-networkinternet-issues.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/5023177697533587406'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/5023177697533587406'/><link rel='alternate' type='text/html' href='http://fahadnct.blogspot.com/2010/03/debug-mac-os-x-networkinternet-issues.html' title='Debug Mac OS X network/internet issues with lsof'/><author><name>fahad syamlan</name><uri>http://www.blogger.com/profile/06708957413852542769</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7517427329637873814.post-5707571538039046469</id><published>2010-03-02T05:15:00.003-08:00</published><updated>2010-03-02T05:16:40.617-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Mac OS X'/><title type='text'>How to use a Time Capsule as a Mac network drive</title><content type='html'>&lt;p&gt;I now have a small network of Apple/Mac systems here at the devdaily.com world headquarters, and as I'm starting to feel the need for a network, I looked around, and lo-and-behold, I found my old &lt;a href="http://www.apple.com/timecapsule/"&gt;Apple Time Capsule&lt;/a&gt;. Could a &lt;em&gt;Time Capsule&lt;/em&gt; work as a Mac network drive?&lt;/p&gt;  &lt;p&gt;It didn't take much to find out; I just opened the Finder on one of my systems, navigated to the Time Capsule device (see below), and created a folder on the Time Capsule named "Shared". I dropped 100 videos from &lt;a href="http://onemansalaska.com/"&gt;my life in Alaska&lt;/a&gt; into the folder from my older &lt;a href="http://www.apple.com/macbookpro/"&gt;MacBook Pro&lt;/a&gt;, and then picked them up from my newer &lt;a href="http://www.apple.com/imac/"&gt;iMac&lt;/a&gt;, and a short while later I had a decent video created in &lt;a href="http://www.apple.com/ilife/imovie/"&gt;iMovie&lt;/a&gt;.&lt;/p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_HQp2LN0-ECo/S40Plap4b2I/AAAAAAAAAAc/n-ltMBRL8vE/s1600-h/time-capsule-network-drive.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 226px;" src="http://1.bp.blogspot.com/_HQp2LN0-ECo/S40Plap4b2I/AAAAAAAAAAc/n-ltMBRL8vE/s320/time-capsule-network-drive.png" alt="" id="BLOGGER_PHOTO_ID_5444024660045360994" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;As you can see from that Finder image, I use the Time Capsule to back up my two Mac systems already. You can see this when you look at the Time Capsule from the Mac Finder, where these &lt;a href="http://www.apple.com/macosx/what-is-macosx/time-machine.html"&gt;Time Machine&lt;/a&gt; backups appear as files with the filename extension "sparsebundle".&lt;/p&gt; &lt;h2&gt;Time Capsule as a network drive/share - summary&lt;/h2&gt; &lt;p&gt;So far the Time Capsule has worked well as a network drive/share. I'm not sure if it's an 'ideal' Mac network drive, but it works well for my limited needs.&lt;/p&gt; &lt;p&gt;The reason I'm not sure if it's ideal is that the Time Capsule seems to go to sleep when it's not in use, so there is a pause when I first access it after not using it for a while. That being said, it is ideal in that (a) it's already there, (b) it has plenty of free disk space, (c) I don't have to go out and buy another Mac network drive device.&lt;/p&gt; &lt;p&gt;I'll update this article with more information as I learn it, but so far, so good.&lt;/p&gt;&lt;h2&gt;Time Capsule as network share - update&lt;/h2&gt; &lt;p&gt;It's almost four weeks since I first wrote this article, and I'm about to get away from writing for a little while, so I wanted to note that the Time Capsule continues to work fine as both a Time Machine backup device, as well as serving as a network drive/share that I can use for my Mac OS X systems. I haven't had any problems using the Time Capsule this way, and it really is a nice way to re-use a networked hard drive that you may already own.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7517427329637873814-5707571538039046469?l=fahadnct.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fahadnct.blogspot.com/feeds/5707571538039046469/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://fahadnct.blogspot.com/2010/03/how-to-use-time-capsule-as-mac-network.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/5707571538039046469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/5707571538039046469'/><link rel='alternate' type='text/html' href='http://fahadnct.blogspot.com/2010/03/how-to-use-time-capsule-as-mac-network.html' title='How to use a Time Capsule as a Mac network drive'/><author><name>fahad syamlan</name><uri>http://www.blogger.com/profile/06708957413852542769</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_HQp2LN0-ECo/S40Plap4b2I/AAAAAAAAAAc/n-ltMBRL8vE/s72-c/time-capsule-network-drive.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7517427329637873814.post-668479012069495589</id><published>2010-03-02T05:15:00.001-08:00</published><updated>2010-03-02T05:15:24.080-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Mac OS X'/><title type='text'>Improve your MacBook battery life</title><content type='html'>&lt;p&gt;Wow, I'm feeling pretty dumb at the moment ... I had no idea I was supposed to calibrate my MacBook Pro battery every month. I just found this out while trying to help a friend who was having some MacBook battery problems.&lt;/p&gt;  &lt;p&gt;Personally, I've been really happy with the battery life I get out of my old &lt;a href="http://www.apple.com/macbookpro/"&gt;MacBook Pro&lt;/a&gt;, as I've written about in my "&lt;a href="http://www.devdaily.com/blog/post/mac-os-x/how-extend-macbook-pro-battery-life"&gt;Extending my MacBook battery life&lt;/a&gt;" article. But if I can get a little more MacBook battery life, I'm all ears.&lt;/p&gt; &lt;p&gt;I'm not going to provide any more details about this here, as &lt;a href="http://www.apple.com/"&gt;Apple&lt;/a&gt; has this "calibrate your MacBook battery" topic covered very well in the following articles. But, I will come back here after trying these calibration techniques on my MacBook Pro to report how they worked.&lt;/p&gt; &lt;p&gt;Here are links to Apple's battery calibration articles:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;a href="http://support.apple.com/kb/HT1490"&gt;Calibrating your computer's battery for best performance&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.apple.com/batteries/"&gt;Apple "batteries" page&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.apple.com/batteries/notebooks.html"&gt;Apple notebooks battery page (MacBook, MacBook Pro, etc.)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.apple.com/batteries/iphone.html"&gt;Apple iPhone battery page&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.apple.com/batteries/ipods.html"&gt;Apple iPod battery page&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;I like one of their tips: "Use your iPod regularly". I know that makes technical sense from a battery perspective, but it sounds self-serving, like something a cigarette maker would tell their customers: "Smoke regularly".&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7517427329637873814-668479012069495589?l=fahadnct.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fahadnct.blogspot.com/feeds/668479012069495589/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://fahadnct.blogspot.com/2010/03/improve-your-macbook-battery-life.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/668479012069495589'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/668479012069495589'/><link rel='alternate' type='text/html' href='http://fahadnct.blogspot.com/2010/03/improve-your-macbook-battery-life.html' title='Improve your MacBook battery life'/><author><name>fahad syamlan</name><uri>http://www.blogger.com/profile/06708957413852542769</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7517427329637873814.post-3891095361903151976</id><published>2010-03-02T05:13:00.000-08:00</published><updated>2010-03-02T05:14:34.984-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Mac OS X'/><title type='text'>New Google Chrome for Mac OS X release</title><content type='html'>&lt;p&gt;Google released a new beta version of the &lt;em&gt;Google Chrome browser for Mac OS X&lt;/em&gt; late last week. To see if you have this new release as an automatic update, look on the Chrome About dialog, and this new release is labeled "5.0.307.7 beta".&lt;/p&gt; &lt;p&gt;The new Google Chrome for Mac OS X browser contains the following new features:&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;Access to over 2,200 Chrome extensions.&lt;/li&gt;&lt;li&gt;A bookmarks manager.&lt;/li&gt;&lt;li&gt;A way to synchronize your bookmarks across all your computer systems, whether they are Mac OS X, Linux, or Windows. This requires a Google user account.&lt;/li&gt;&lt;li&gt;A new Task Manager (which you can access in the menu system: View &gt; Developer &gt; Task Manager). This lets you keep an eye on memory and CPU use of the Chrome browser, each tab in the browser, and plugin memory use (such as "Shockwave Flash" currently using 40.5MB RAM and 4.5% CPU). I have to admit, it is funny to see the Flash plugin eat memory and CPU while no animations are even running.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;One note on the Google Chrome Extensions: I've tried to install several "mouse gestures" plugins, and they do not work on Mac OS X at this time.&lt;/p&gt; &lt;p&gt;As another Chrome extensions note, I prefer to keep my bookmarks on Delicious, but so far the Delicious plugins I've seen for Chrome are much more limited than the Firefox Delicious plugin I normally use.&lt;/p&gt;&lt;h2&gt;Mac browsers: Chrome, Firefox, and Safari&lt;/h2&gt; &lt;p&gt;Firefox is probably still my favorite Mac OS X browser, but Chrome is getting to be a very close #2.&lt;/p&gt; &lt;p&gt;Which begs the question: &lt;em&gt;When will Apple have a long-needed update for Safari available?&lt;/em&gt; The Chrome developer team seems to be running at a much faster pace than the Safari developer team.&lt;/p&gt; &lt;h2&gt;Google Chrome for Mac OS X links&lt;/h2&gt; &lt;p&gt;Here are several links related to the new &lt;em&gt;Chrome for Mac OS X&lt;/em&gt; release:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;a href="https://chrome.google.com/extensions/"&gt;Google Chrome Extensions&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://chrome.blogspot.com/2010/02/new-beta-of-google-chrome-for-mac-with.html"&gt;Google's release statement&lt;/a&gt; about Chrome for Mac OS X.&lt;/li&gt;&lt;li&gt;&lt;a href="https://tools.google.com/chrome/intl/en/themes/index.html"&gt;Google Chrome themes&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7517427329637873814-3891095361903151976?l=fahadnct.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fahadnct.blogspot.com/feeds/3891095361903151976/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://fahadnct.blogspot.com/2010/03/new-google-chrome-for-mac-os-x-release.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/3891095361903151976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/3891095361903151976'/><link rel='alternate' type='text/html' href='http://fahadnct.blogspot.com/2010/03/new-google-chrome-for-mac-os-x-release.html' title='New Google Chrome for Mac OS X release'/><author><name>fahad syamlan</name><uri>http://www.blogger.com/profile/06708957413852542769</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7517427329637873814.post-6679544229711521307</id><published>2010-03-02T05:12:00.001-08:00</published><updated>2010-03-02T05:12:50.790-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>How do I show Linux disk space information?</title><content type='html'>&lt;p&gt;Linux FAQ: How do I show Linux disk space information? (Also stated as, What is the Linux disk space command?)&lt;/p&gt; &lt;p&gt;Answer: You show Linux disk space information with the Linux &lt;code&gt;df&lt;/code&gt; command. I have &lt;a href="http://www.devdaily.com/unix/edu/examples/df.shtml"&gt;a more detailed Linux df command example&lt;/a&gt;, but in short, I typically use the Linux df command like this, with the &lt;code&gt;-h&lt;/code&gt; option:&lt;/p&gt; &lt;pre&gt;df -h&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;The &lt;code&gt;-h&lt;/code&gt; option stands for "human readable", and I almost always use that option instead of using the &lt;code&gt;df&lt;/code&gt; command by itself.&lt;/p&gt; &lt;p&gt;On a very simple Linux server that I use, the output of this &lt;code&gt;df -h&lt;/code&gt; command looks like this:&lt;/p&gt; &lt;pre&gt;Filesystem   Size  Used  Avail  Use%  Mounted on&lt;br /&gt;/dev/vzfs    10G   5.6G  4.5G   56%   /&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;Again, for a little more information, visit &lt;a href="http://www.devdaily.com/unix/edu/examples/df.shtml"&gt;our Linux df command example tutorial&lt;/a&gt;, or visit our online version of &lt;a href="http://www.devdaily.com/linux/linux-df-command-man-page"&gt;the df command man page&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7517427329637873814-6679544229711521307?l=fahadnct.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fahadnct.blogspot.com/feeds/6679544229711521307/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://fahadnct.blogspot.com/2010/03/how-do-i-show-linux-disk-space.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/6679544229711521307'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/6679544229711521307'/><link rel='alternate' type='text/html' href='http://fahadnct.blogspot.com/2010/03/how-do-i-show-linux-disk-space.html' title='How do I show Linux disk space information?'/><author><name>fahad syamlan</name><uri>http://www.blogger.com/profile/06708957413852542769</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7517427329637873814.post-3734569892339701675</id><published>2010-03-02T05:08:00.000-08:00</published><updated>2010-03-02T05:09:48.378-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Linux find error - missing argument to -exec</title><content type='html'>&lt;p&gt;I just issued a Linux find command, and got the following error message:&lt;/p&gt; &lt;pre&gt;find: missing argument to -exec&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;Amazingly, it turns out that the computer is right, and I messed up my command. I entered my find command like this:&lt;/p&gt;  &lt;pre&gt;find . -type f -exec grep -il mail&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;That's the way I &lt;em&gt;want&lt;/em&gt; to type this command, but the &lt;em&gt;correct way&lt;/em&gt; to type it is to add the extra characters at the end of the command, like this:&lt;/p&gt; &lt;pre&gt;find . -type f -exec grep -il mail {} \;&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;Once I added those &lt;code&gt;{} \;&lt;/code&gt; characters at the end of my find command, the find error message went away.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7517427329637873814-3734569892339701675?l=fahadnct.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fahadnct.blogspot.com/feeds/3734569892339701675/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://fahadnct.blogspot.com/2010/03/linux-find-error-missing-argument-to.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/3734569892339701675'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/3734569892339701675'/><link rel='alternate' type='text/html' href='http://fahadnct.blogspot.com/2010/03/linux-find-error-missing-argument-to.html' title='Linux find error - missing argument to -exec'/><author><name>fahad syamlan</name><uri>http://www.blogger.com/profile/06708957413852542769</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7517427329637873814.post-7766717779206516133</id><published>2010-03-02T05:07:00.000-08:00</published><updated>2010-03-02T05:08:24.263-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>The Unix and Linux ps command</title><content type='html'>&lt;h2&gt;The basic ps command&lt;/h2&gt; &lt;p&gt;The Linux ps command by itself only shows minimal information about the processes &lt;em&gt;you&lt;/em&gt; are currently running. If you issue the basic command like this without any arguments:&lt;/p&gt; &lt;pre&gt;ps&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;you'll see output from this command looks something like this:&lt;/p&gt; &lt;pre&gt;  PID TTY           TIME CMD&lt;br /&gt;4343 ttys000    0:00.35 -bash&lt;br /&gt;2617 ttys001    0:00.65 -bash&lt;br /&gt;18201 ttys003    0:00.27 -bash&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;The PID column shows the process-id, the second column shows the TTY (terminal) the process is attached to, the TIME column shows how much CPU time the process has used, and the CMD column shows the command that is running. In this case I can tell (from experience) that I have three bash shells (terminals) running on my current system.&lt;/p&gt; &lt;p&gt;In practice I never run the ps command without any arguments like this, but I wanted to show this to help us get started.&lt;/p&gt; &lt;p&gt;There are &lt;em&gt;many&lt;/em&gt; ways to customize the output of the ps command. For instance, I can add the 'f' argument to get "full" information about each process. Used by itself, the 'f' argument shows "full" information about just my processes. As an example, this command:&lt;/p&gt; &lt;pre&gt;ps -f&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;leads to this output:&lt;/p&gt; &lt;pre&gt;  UID   PID  PPID   C     STIME TTY           TIME CMD&lt;br /&gt; 501  4343  4342   0   0:00.18 ttys000    0:00.35 -bash&lt;br /&gt; 501  2617  2616   0   0:00.41 ttys001    0:00.66 -bash&lt;br /&gt; 501 18201 18200   0   0:00.15 ttys003    0:00.27 -bash&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;As you can see this adds a few more columns of output to my ps command, including UID (user-id), PPID (parent process-id), and a couple of other columns I don't really look at.&lt;/p&gt; &lt;h2&gt;Showing information about every process&lt;/h2&gt; &lt;p&gt;As mentioned, those two commands just show information about &lt;em&gt;your&lt;/em&gt; processes. If you're a Linux system administrator, you're typically interested in information about &lt;em&gt;all&lt;/em&gt; the processes running on the system. To show &lt;em&gt;every&lt;/em&gt; process running on the system, we add the 'e' argument to our previous ps command, like this:&lt;/p&gt; &lt;pre&gt;ps -ef&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;This leads to much more output:&lt;/p&gt; &lt;pre&gt;UID        PID  PPID  C STIME TTY          TIME CMD&lt;br /&gt;root         1     0  0 Oct21 ?        00:00:01 init [3]                                             &lt;br /&gt;root         2     1  0 Oct21 ?        00:00:00 [migration/0]&lt;br /&gt;root         3     1  0 Oct21 ?        00:00:00 [ksoftirqd/0]&lt;br /&gt;root         4     1  0 Oct21 ?        00:00:00 [watchdog/0]&lt;br /&gt;root         5     1  0 Oct21 ?        00:00:00 [migration/1]&lt;br /&gt;root         6     1  0 Oct21 ?        00:00:00 [ksoftirqd/1]&lt;br /&gt;root         7     1  0 Oct21 ?        00:00:00 [watchdog/1]&lt;br /&gt;root         8     1  0 Oct21 ?        00:00:00 [events/0]&lt;br /&gt;root         9     1  0 Oct21 ?        00:00:00 [events/1]&lt;br /&gt;root        10     1  0 Oct21 ?        00:00:00 [khelper]&lt;br /&gt;root        11     1  0 Oct21 ?        00:00:00 [kthread]&lt;br /&gt;root        15    11  0 Oct21 ?        00:00:00 [kblockd/0]&lt;br /&gt;root        16    11  0 Oct21 ?        00:00:00 [kblockd/1]&lt;br /&gt;root        17    11  0 Oct21 ?        00:00:00 [kacpid]&lt;br /&gt;root        91    11  0 Oct21 ?        00:00:00 [cqueue/0]&lt;br /&gt;root        92    11  0 Oct21 ?        00:00:00 [cqueue/1]&lt;br /&gt;root        95    11  0 Oct21 ?        00:00:00 [khubd]&lt;br /&gt;root        97    11  0 Oct21 ?        00:00:00 [kseriod]&lt;br /&gt;root       158    11  0 Oct21 ?        00:00:00 [pdflush]&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;That was actually just the first 20 lines of output from my CentOS Linux test system. This command actually generated 99 lines of output, and I cropped it to just show the first 20 lines.&lt;/p&gt; &lt;p&gt;As mentioned, that's the older way to list processes on a Unix system (and it may still be preferred on Unix systems like HP-UX, AIX, and Solaris; I don't really know, I just use Linux and Mac OS X these days). I wanted to show these options to you (a) to help you learn about the ps command, and (b) see that there are other ps command options than what most people use on a day to day basis. Given that background, let's take a look at how the ps command is typically used on Linux systems.&lt;/p&gt; &lt;h2&gt;How the Linux ps command is typically used&lt;/h2&gt; &lt;p&gt;Now that you've seen some ps command arguments and sample output, here's how I typically use the ps command:&lt;/p&gt; &lt;pre&gt;ps auxwww | more&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;The first 20 lines of output from this command look like this:&lt;/p&gt; &lt;pre&gt;USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND&lt;br /&gt;root         1  0.0  0.0   2064   620 ?        Ss   Oct21   0:01 init [3]                                             &lt;br /&gt;root         2  0.0  0.0      0     0 ?        S&lt;   Oct21   0:00 [migration/0]&lt;br /&gt;root         3  0.0  0.0      0     0 ?        SN   Oct21   0:00 [ksoftirqd/0]&lt;br /&gt;root         4  0.0  0.0      0     0 ?        S&lt;   Oct21   0:00 [watchdog/0]&lt;br /&gt;root         5  0.0  0.0      0     0 ?        S&lt;   Oct21   0:00 [migration/1]&lt;br /&gt;root         6  0.0  0.0      0     0 ?        SN   Oct21   0:00 [ksoftirqd/1]&lt;br /&gt;root         7  0.0  0.0      0     0 ?        S&lt;   Oct21   0:00 [watchdog/1]&lt;br /&gt;root         8  0.0  0.0      0     0 ?        S&lt;   Oct21   0:00 [events/0]&lt;br /&gt;root         9  0.0  0.0      0     0 ?        S&lt;   Oct21   0:00 [events/1]&lt;br /&gt;root        10  0.0  0.0      0     0 ?        S&lt;   Oct21   0:00 [khelper]&lt;br /&gt;root        11  0.0  0.0      0     0 ?        S&lt;   Oct21   0:00 [kthread]&lt;br /&gt;root        15  0.0  0.0      0     0 ?        S&lt;   Oct21   0:00 [kblockd/0]&lt;br /&gt;root        16  0.0  0.0      0     0 ?        S&lt;   Oct21   0:00 [kblockd/1]&lt;br /&gt;root        17  0.0  0.0      0     0 ?        S&lt;   Oct21   0:00 [kacpid]&lt;br /&gt;root        91  0.0  0.0      0     0 ?        S&lt;   Oct21   0:00 [cqueue/0]&lt;br /&gt;root        92  0.0  0.0      0     0 ?        S&lt;   Oct21   0:00 [cqueue/1]&lt;br /&gt;root        95  0.0  0.0      0     0 ?        S&lt;   Oct21   0:00 [khubd]&lt;br /&gt;root        97  0.0  0.0      0     0 ?        S&lt;   Oct21   0:00 [kseriod]&lt;br /&gt;root       158  0.0  0.0      0     0 ?        S    Oct21   0:00 [pdflush]&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;As you can see, this output is similar to the earlier output, but the columns are different. Before I talk about these ps command arguments, let me show a few more examples. Here's how I look at all &lt;code&gt;httpd&lt;/code&gt; processes running on my Linux system:&lt;/p&gt; &lt;pre&gt;$ ps auxwww | grep http&lt;br /&gt;&lt;br /&gt;root      2928  0.0  0.6  17648  7120 ?        Ss   Oct21   0:00 /usr/local/apache2/bin/httpd -k start&lt;br /&gt;nobody    2949  0.0  0.6  17648  6492 ?        S    Oct21   0:00 /usr/local/apache2/bin/httpd -k start&lt;br /&gt;nobody    2950  0.0  0.6  17648  6492 ?        S    Oct21   0:00 /usr/local/apache2/bin/httpd -k start&lt;br /&gt;nobody    2951  0.0  0.6  17648  6492 ?        S    Oct21   0:00 /usr/local/apache2/bin/httpd -k start&lt;br /&gt;nobody    2952  0.0  0.6  17648  6492 ?        S    Oct21   0:00 /usr/local/apache2/bin/httpd -k start&lt;br /&gt;nobody    2953  0.0  0.6  17648  6492 ?        S    Oct21   0:00 /usr/local/apache2/bin/httpd -k start&lt;br /&gt;root     18508  0.0  0.0   3916   688 pts/0    S+   11:12   0:00 grep http&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;Here's how I list all my &lt;code&gt;mysql&lt;/code&gt; processes:&lt;/p&gt; &lt;pre&gt;$ ps auxwww | grep mysql&lt;br /&gt;&lt;br /&gt;root      2837  0.0  0.1   4528  1236 ?        S    Oct21   0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid&lt;br /&gt;mysql     2897  0.0  1.7 136700 17952 ?        Sl   Oct21   0:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-external-locking --socket=/var/lib/mysql/mysql.sock&lt;br /&gt;root     18510  0.0  0.0   3916   712 pts/0    S+   11:13   0:00 grep mysql&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;Now that you've seen a few ps command examples, this is what the arguments to this ps command mean:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;The 'a' argument means "show all processes", not just &lt;em&gt;my&lt;/em&gt; processes. (There's a bit more to it than that, but this is usually close enough.)&lt;/li&gt;&lt;li&gt;The 'u' argument adds "user information" columns to the output. (Try your ps command without the 'u', and you'll see a major difference in the columns that are displayed.)&lt;/li&gt;&lt;li&gt;The 'x' lifts the BSD-style "must have a tty" restriction, meaning it will show processes that are not associated with a terminal (tty)&gt;&lt;/li&gt;&lt;li&gt;The 'w' means "wide output". Use this option twice for unlimited width.&lt;h2&gt;Examples from the Linux ps command man page&lt;/h2&gt; &lt;p&gt;My intention for this article was to help get a new Unix or Linux user get started with the ps command. Before going, there are two more things I want to share with you. First, there are many different variations of the ps command that you &lt;em&gt;can&lt;/em&gt; use if you want to. For instance, I just looked at the Linux ps man page, and found these ps command examples:&lt;/p&gt; &lt;pre&gt;EXAMPLES&lt;br /&gt;To see every process on the system using standard syntax:&lt;br /&gt;  ps -e&lt;br /&gt;  ps -ef&lt;br /&gt;  ps -eF&lt;br /&gt;  ps -ely&lt;br /&gt;&lt;br /&gt;To see every process on the system using BSD syntax:&lt;br /&gt;  ps ax&lt;br /&gt;  ps axu&lt;br /&gt;&lt;br /&gt;To print a process tree:&lt;br /&gt;  ps -ejH&lt;br /&gt;  ps axjf&lt;br /&gt;&lt;br /&gt;To get info about threads:&lt;br /&gt;  ps -eLf&lt;br /&gt;  ps axms&lt;br /&gt;&lt;br /&gt;To get security info:&lt;br /&gt;  ps -eo euser,ruser,suser,fuser,f,comm,label&lt;br /&gt;  ps axZ&lt;br /&gt;  ps -eM&lt;br /&gt;&lt;br /&gt;To see every process running as root (real &amp;amp; effective ID) in user format:&lt;br /&gt;  ps -U root -u root u&lt;br /&gt;&lt;br /&gt;To see every process with a user-defined format:&lt;br /&gt;  ps -eo pid,tid,class,rtprio,ni,pri,psr,pcpu,stat,wchan:14,comm&lt;br /&gt;  ps axo stat,euid,ruid,tty,tpgid,sess,pgrp,ppid,pid,pcpu,comm&lt;br /&gt;  ps -eopid,tt,user,fname,tmout,f,wchan&lt;br /&gt;&lt;br /&gt;Print only the process IDs of syslogd:&lt;br /&gt;  ps -C syslogd -o pid=&lt;br /&gt;&lt;br /&gt;Print only the name of PID 42:&lt;br /&gt;  ps -p 42 -o comm=&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;As you can see, there are a &lt;em&gt;lot&lt;/em&gt; of different ways to issue a Unix or Linux ps command, and I try to show some of those in this other tutorial on how to sort Linux ps command output.&lt;/p&gt; &lt;p&gt;The second thing I want to mention is the &lt;em&gt;Linux top command&lt;/em&gt;.&lt;/p&gt;&lt;h2&gt;The Unix and Linux top command&lt;/h2&gt; &lt;p&gt;Unix and Linux systems now include a nice interactive utility for looking at process information. The &lt;em&gt;Linux top command&lt;/em&gt; displays a character-based screen of all processes running on the current system. The screen updates itself every few seconds, and you can sort the screen contents by characteristics like CPU Usage or Memory Use.&lt;/p&gt; &lt;p&gt;I show how to use the top command in this &lt;a href="http://www.devdaily.com/linux/unix-linux-top-command-cpu-memory"&gt;Unix/Linux top command tutorial&lt;/a&gt;, which includes several screenshots of the top command running on a Linux system.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7517427329637873814-7766717779206516133?l=fahadnct.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fahadnct.blogspot.com/feeds/7766717779206516133/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://fahadnct.blogspot.com/2010/03/unix-and-linux-ps-command.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/7766717779206516133'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/7766717779206516133'/><link rel='alternate' type='text/html' href='http://fahadnct.blogspot.com/2010/03/unix-and-linux-ps-command.html' title='The Unix and Linux ps command'/><author><name>fahad syamlan</name><uri>http://www.blogger.com/profile/06708957413852542769</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7517427329637873814.post-1820549684519293994</id><published>2010-03-02T04:58:00.000-08:00</published><updated>2010-03-02T05:06:37.080-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>The Linux top command</title><content type='html'>Unix and Linux systems include a nice interactive utility for looking at process information. The &lt;em&gt;Linux top command&lt;/em&gt; displays a character-based screen of all processes running on the current system. The screen updates itself every few seconds, and you can sort the screen contents by characteristics like CPU Usage or Memory Use. &lt;p&gt;In this tutorial we'll take a look at the most common uses of the top command, including showing how to sort the output by CPU and memory use, and change the top command display.&lt;/p&gt; &lt;h2&gt;The Unix and Linux top command&lt;/h2&gt; &lt;p&gt;When you issue the top command like this:&lt;/p&gt; &lt;pre&gt;top&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;you'll see a screen that looks something like this:&lt;/p&gt;&lt;h2&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_HQp2LN0-ECo/S40MU7stH1I/AAAAAAAAAAM/4BFMg7bOdz0/s1600-h/unix-linux-top-command.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px; height: 221px;" src="http://4.bp.blogspot.com/_HQp2LN0-ECo/S40MU7stH1I/AAAAAAAAAAM/4BFMg7bOdz0/s320/unix-linux-top-command.png" alt="" id="BLOGGER_PHOTO_ID_5444021078322913106" border="0" /&gt;&lt;/a&gt;&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;As mentioned, this display will update itself automatically, depending on any settings that you have configured, and the version of the top command you're using.&lt;/p&gt; &lt;h2&gt;Linux top command help&lt;/h2&gt; &lt;p&gt;To get help on how to use the top command, just press the letter '?' or 'h' when the top command is running. Doing so will display the following top command help screen:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_HQp2LN0-ECo/S40MVPGPL-I/AAAAAAAAAAU/MdoF_slCDCs/s1600-h/unix-linux-top-command-help.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px; height: 221px;" src="http://3.bp.blogspot.com/_HQp2LN0-ECo/S40MVPGPL-I/AAAAAAAAAAU/MdoF_slCDCs/s320/unix-linux-top-command-help.png" alt="" id="BLOGGER_PHOTO_ID_5444021083530276834" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;In case I made that image too small, here's the content of this top help screen in text format:&lt;/p&gt; &lt;pre&gt;Z,B       Global: 'Z' change color mappings; 'B' disable/enable bold&lt;br /&gt;l,t,m     Toggle Summaries: 'l' load avg; 't' task/cpu stats; 'm' mem info&lt;br /&gt;1,I       Toggle SMP view: '1' single/separate states; 'I' Irix/Solaris mode&lt;br /&gt;&lt;br /&gt;f,o     . Fields/Columns: 'f' add or remove; 'o' change display order&lt;br /&gt;F or O  . Select sort field&lt;br /&gt;&lt;,&gt;     . Move sort field: '&lt;' next col left; '&gt;' next col right&lt;br /&gt;R,H     . Toggle: 'R' normal/reverse sort; 'H' show threads&lt;br /&gt;c,i,S   . Toggle: 'c' cmd name/line; 'i' idle tasks; 'S' cumulative time&lt;br /&gt;x,y     . Toggle highlights: 'x' sort field; 'y' running tasks&lt;br /&gt;z,b     . Toggle: 'z' color/mono; 'b' bold/reverse (only if 'x' or 'y')&lt;br /&gt;u       . Show specific user only&lt;br /&gt;n or #  . Set maximum tasks displayed&lt;br /&gt;&lt;br /&gt;k,r       Manipulate tasks: 'k' kill; 'r' renice&lt;br /&gt;d or s    Set update interval&lt;br /&gt;W         Write configuration file&lt;br /&gt;q         Quit&lt;br /&gt;      ( commands shown with '.' require a visible task display window )&lt;br /&gt;Press 'h' or '?' for help with Windows,&lt;br /&gt;&lt;/pre&gt; &lt;h2&gt;Sorting the top command display&lt;/h2&gt; &lt;p&gt;In my opinion, the most important thing you need to know from this help screen is how to sort the top command display/output. Using the top command that came with my CentOS Linux system as of September, 2009, you sort the top command output by first pressing the 'O' key (the uppercase letter 'o'), then choosing a sort column on the following screen.&lt;/p&gt; &lt;p&gt;Here are two quick examples. First, to sort the top command output by memory use, follow these steps:&lt;/p&gt; &lt;ol&gt;&lt;li&gt;Press 'O'&lt;/li&gt;&lt;li&gt;Press 'N'&lt;/li&gt;&lt;li&gt;Press [Enter]&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;Or, to sort the top command display by CPU usage, follow these steps:&lt;/p&gt; &lt;ol&gt;&lt;li&gt;Press 'O'&lt;/li&gt;&lt;li&gt;Press 'K'&lt;/li&gt;&lt;li&gt;Press [Enter]&lt;h2&gt;Unix top command sort options&lt;/h2&gt; &lt;p&gt;Here's the text version of the top command sort options screen:&lt;/p&gt; &lt;pre&gt;Current Sort Field:  K  for window 1:Def&lt;br /&gt;Select sort field via field letter, type any other key to return&lt;br /&gt;&lt;br /&gt;a: PID        = Process Id                   z: Flags      = Task Flags &lt;sched.h&gt;&lt;br /&gt;b: PPID       = Parent Process Pid&lt;br /&gt;c: RUSER      = Real user name             Note1:&lt;br /&gt;d: UID        = User Id                      If a selected sort field can't be&lt;br /&gt;e: USER       = User Name                    shown due to screen width or your&lt;br /&gt;f: GROUP      = Group Name                   field order, the '&lt;' and '&gt;' keys&lt;br /&gt;g: TTY        = Controlling Tty              will be unavailable until a field&lt;br /&gt;h: PR         = Priority                     within viewable range is chosen.&lt;br /&gt;i: NI         = Nice value&lt;br /&gt;j: P          = Last used cpu (SMP)        Note2:&lt;br /&gt;* K: %CPU       = CPU usage                    Field sorting uses internal values,&lt;br /&gt;l: TIME       = CPU Time                     not those in column display.  Thus,&lt;br /&gt;m: TIME+      = CPU Time, hundredths         the TTY &amp;amp; WCHAN fields will violate&lt;br /&gt;n: %MEM       = Memory usage (RES)           strict ASCII collating sequence.&lt;br /&gt;o: VIRT       = Virtual Image (kb)           (shame on you if WCHAN is chosen)&lt;br /&gt;p: SWAP       = Swapped size (kb)&lt;br /&gt;q: RES        = Resident size (kb)&lt;br /&gt;r: CODE       = Code size (kb)&lt;br /&gt;s: DATA       = Data+Stack size (kb)&lt;br /&gt;t: SHR        = Shared Mem size (kb)&lt;br /&gt;u: nFLT       = Page Fault count&lt;br /&gt;v: nDRT       = Dirty Pages count&lt;br /&gt;w: S          = Process Status&lt;br /&gt;x: COMMAND    = Command name/line&lt;br /&gt;y: WCHAN      = Sleeping in Function&lt;br /&gt;&lt;/sched.h&gt;&lt;/pre&gt; &lt;p&gt;As you can see from that output, you can sort the top command output by many different pieces of process information. The asterisk indicates that the output is currently sorted by the %CPU column.&lt;/p&gt;&lt;h2&gt;Linux and Unix top command - closing notes&lt;/h2&gt; &lt;p&gt;To exit/quit the top command, just type the letter 'q'.&lt;/p&gt; &lt;p&gt;The top command implementation is pretty different on Mac OS X. The top command itself brings up a screen, but the columns are different by default, and the commands you can issue are different. I'm not going to get into all the details for Mac OS X, but just use the '?' to get help.&lt;/p&gt; &lt;p&gt;You can control "summary" lines that are displayed on the top lines of the top command display. Use the following one-letter commands to toggle the display of the lines at the top of the display:&lt;br /&gt;&lt;br /&gt;load average&lt;br /&gt;m - memory&lt;br /&gt;t - task/cpu stats&lt;/p&gt; &lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7517427329637873814-1820549684519293994?l=fahadnct.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fahadnct.blogspot.com/feeds/1820549684519293994/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://fahadnct.blogspot.com/2010/03/linux-top-command.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/1820549684519293994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/1820549684519293994'/><link rel='alternate' type='text/html' href='http://fahadnct.blogspot.com/2010/03/linux-top-command.html' title='The Linux top command'/><author><name>fahad syamlan</name><uri>http://www.blogger.com/profile/06708957413852542769</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_HQp2LN0-ECo/S40MU7stH1I/AAAAAAAAAAM/4BFMg7bOdz0/s72-c/unix-linux-top-command.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7517427329637873814.post-2763262766346758278</id><published>2010-03-02T04:54:00.000-08:00</published><updated>2010-03-02T04:59:15.305-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Linux "crontab every" examples</title><content type='html'>&lt;p&gt;I've posted other Unix and Linux crontab tutorials here before How to edit your Linux crontab file, &lt;, but I've never included a tutorial that covers the "crontab every" options, as in how to run a crontab command &lt;em&gt;every minute&lt;/em&gt;, or &lt;em&gt;every hour&lt;/em&gt;, or &lt;em&gt;every day&lt;/em&gt;.&lt;/p&gt;  &lt;p&gt;To that end, here are some quick "crontab every" example entries that show the syntax for these crontab commands.&lt;/p&gt;  &lt;h2&gt;&lt;span style="font-size:130%;"&gt;Linux crontab - run a command every minute&lt;/span&gt;&lt;/h2&gt; &lt;p&gt;To run a Unix or Linux crontab command every minute, use this crontab syntax:&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;pre&gt;# run this command every minute of every day to check apache&lt;br /&gt;* * * * * /var/www/devdaily.com/bin/check-apache.sh&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;I created that entry when I was having a problem with Apache, and needed to run a test every minute of every day to see that it was running properly. All those "*" symbols are what make this command run every minute. Specifically, those first five fields have the following meanings:&lt;/p&gt; &lt;pre&gt;# field #   meaning        allowed values&lt;br /&gt;# -------   ------------   --------------&lt;br /&gt;#    1      minute         0-59&lt;br /&gt;#    2      hour           0-23&lt;br /&gt;#    3      day of month   1-31&lt;br /&gt;#    4      month          1-12 (or names, see below)&lt;br /&gt;#    5      day of week    0-7 (0 or 7 is Sun, or use names)&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;I'm assuming some previous knowledge of the crontab syntax in this tutorial, so I won't discuss this much, but what I'm trying to show here is that in the first field you specify the "Minute" value, in the second field you specify the "Hour", followed by Day Of Month, then Month, and finally Day Of Week. We'll see more examples as we go along.&lt;/p&gt; &lt;h2&gt;&lt;span style="font-size:130%;"&gt;Run a crontab command every hour&lt;/span&gt;&lt;/h2&gt; &lt;p&gt;To run a Linux or Unix crontab every hour of every day, you use a very similar crontab syntax. Here's a crontab entry I use to hit the Drupal &lt;code&gt;cron.php&lt;/code&gt; page five minutes after every hour:&lt;/p&gt; &lt;pre&gt;# hit this url to run the drupal cron process every hour of every day&lt;br /&gt;# this command will run at 12:05, 1:05, etc.&lt;br /&gt;5 * * * * /usr/bin/wget -O - -q -t 1 &lt;a href="http://localhost/cron.php" title="http://localhost/cron.php"&gt;http://localhost/cron.php&lt;/a&gt;&lt;br /&gt;&lt;/pre&gt; &lt;h2&gt;&lt;span style="font-size:130%;"&gt;Run a crontab entry every day&lt;/span&gt;&lt;/h2&gt; &lt;p&gt;Here's a crontab example that shows how to run a command from the cron daemon once every day. In this command I run my backup scripts at 4:30 a.m. every day:&lt;/p&gt; &lt;pre&gt;# run the backup scripts at 4:30am&lt;br /&gt;30 4 * * * /var/www/devdaily.com/bin/create-all-backups.sh&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;h2&gt;&lt;span style="font-size:130%;"&gt;Run a crontab entry every 5 minutes&lt;/span&gt;&lt;/h2&gt; &lt;p&gt;There are a couple of ways to run a crontab entry every five minutes. First, here's the brute force way:&lt;/p&gt; &lt;pre&gt;0,5,10,15,20,25,30,35,40,45,50,55  * * * * /var/www/devdaily.com/bin/do-update.sh&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;That command works just fine, and there's nothing technically wrong with it. It's just that the crontab syntax offers a shortcut for this situation. The crontab step syntax lets you use a crontab entry in the following format to run a Unix or Linux command every five minutes:&lt;/p&gt; &lt;pre&gt;# run this crontab entry every 5 minutes&lt;br /&gt;*/5 * * * * /var/www/devdaily.com/bin/do-update.sh&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;That's a nice convenience feature for situations like this. Here's a nice blurb about the step command syntax from the crontab man page:&lt;/p&gt; &lt;pre&gt;Step values can be used in conjunction with ranges. Following a range&lt;br /&gt;with "&lt;number&gt;" specifies skips of the number’s value through the&lt;br /&gt;range.&lt;br /&gt;&lt;br /&gt;For example, "0-23/2" can be used in the hours field to specify&lt;br /&gt;command execution every other hour (the alternative in the V7 standard&lt;br /&gt;is "0,2,4,6,8,10,12,14,16,18,20,22").&lt;br /&gt;&lt;br /&gt;Steps are also permitted after an asterisk, so if you want to say&lt;br /&gt;"every two hours", just use "*/2".&lt;br /&gt;&lt;/number&gt;&lt;/pre&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;h2&gt;&lt;span style="font-size:130%;"&gt;Unix and Linux "crontab every" summary&lt;/span&gt;&lt;/h2&gt; &lt;p&gt;I hope that's enough Unix/Linux "crontab every" examples to help you run your own crontab commands every minute, every 5 minutes, or every day, or every five minutes, etc.&lt;/p&gt; &lt;p&gt;As usual, if you have any questions, comments, or &lt;em&gt;crontab every&lt;/em&gt; examples to share, just use the comment form below.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7517427329637873814-2763262766346758278?l=fahadnct.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fahadnct.blogspot.com/feeds/2763262766346758278/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://fahadnct.blogspot.com/2010/03/linux-crontab-every-examples.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/2763262766346758278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/2763262766346758278'/><link rel='alternate' type='text/html' href='http://fahadnct.blogspot.com/2010/03/linux-crontab-every-examples.html' title='Linux &quot;crontab every&quot; examples'/><author><name>fahad syamlan</name><uri>http://www.blogger.com/profile/06708957413852542769</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7517427329637873814.post-7831229017920995515</id><published>2010-03-02T04:52:00.000-08:00</published><updated>2010-03-02T04:53:02.480-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Free Unix/Linux and vi/vim cheat sheets</title><content type='html'>&lt;p&gt;I created some "cheat sheets" (reference pages) for a recent Unix and Linux training class. One is a "Unix and Linux commands cheat sheet", and the other is a "vi/vim editor cheat sheet". I'll be sharing the entire "Introduction to Unix" training PDF here shortly, but in the meantime, here are the links to the Unix/Linux and vi/vim cheats:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;a href="http://www.devdaily.com/unix/files/DD-UnixCheatSheet.pdf"&gt;Unix and Linux commands cheat sheet (command reference examples) (pdf)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.devdaily.com/unix/files/DD-ViEditorCheatSheet.pdf"&gt;vi (vim) editor commands cheat sheet (command reference examples) (pdf)&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Both cheat sheets include a lot of nice examples, and hopefully the most common examples. I hope you like them, and I also welcome any suggestions to improve them.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7517427329637873814-7831229017920995515?l=fahadnct.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fahadnct.blogspot.com/feeds/7831229017920995515/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://fahadnct.blogspot.com/2010/03/free-unixlinux-and-vivim-cheat-sheets.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/7831229017920995515'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/7831229017920995515'/><link rel='alternate' type='text/html' href='http://fahadnct.blogspot.com/2010/03/free-unixlinux-and-vivim-cheat-sheets.html' title='Free Unix/Linux and vi/vim cheat sheets'/><author><name>fahad syamlan</name><uri>http://www.blogger.com/profile/06708957413852542769</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7517427329637873814.post-5748537625799521432</id><published>2010-03-02T04:49:00.000-08:00</published><updated>2010-03-02T04:52:23.602-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>A Linux crontab mail command example</title><content type='html'>&lt;p&gt;Here's the source code for a really simple Linux mail script that I used to send an email message to one of my co-workers every month. This script used the Unix or Linux &lt;em&gt;mail command&lt;/em&gt; to email a file to her that showed a list of all the websites on our server that she needed to bill our customers for.&lt;/p&gt; &lt;p&gt;Here's the source code for this simple Linux mail shell script:&lt;/p&gt;#!/bin/sh&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# cd to the directory that contains the file we want to email&lt;br /&gt;cd /web/sites&lt;br /&gt;# send the email with the unix/linux mail command&lt;br /&gt;mail -s "Current customer directories" &lt;a href="mailto:kim@example.com"&gt;fahad.master.com@gmail.com&lt;/a&gt; &amp;lt; listOfWebSites.txt&lt;br /&gt;&lt;/pre&gt;As you might guess from looking at that mail command, the "Current customer directories" string is the subject of the email message, and &lt;code&gt;listOfWebSites.txt&lt;/code&gt; is the file that was sent via email to a person named Kim. The string "kim@example.com" shows where the recipient's email address belongs in the mail command.&lt;br /&gt;&lt;h2&gt;My Linux crontab mail entry&lt;/h2&gt; &lt;p&gt;Next, here's my crontab entry that corresponds to this Linux email script:&lt;/p&gt; &lt;pre&gt;0 5 1 * * /home/al/bin/mailWebSitesToKim.sh&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;If you're familiar with the Unix/Linux crontab syntax, you can see that this command sends this email message once every month, at 5 a.m. on the first day of the month.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7517427329637873814-5748537625799521432?l=fahadnct.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fahadnct.blogspot.com/feeds/5748537625799521432/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://fahadnct.blogspot.com/2010/03/linux-crontab-mail-command-example.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/5748537625799521432'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/5748537625799521432'/><link rel='alternate' type='text/html' href='http://fahadnct.blogspot.com/2010/03/linux-crontab-mail-command-example.html' title='A Linux crontab mail command example'/><author><name>fahad syamlan</name><uri>http://www.blogger.com/profile/06708957413852542769</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7517427329637873814.post-8573527444246149772</id><published>2010-03-02T04:48:00.001-08:00</published><updated>2010-03-02T05:02:15.502-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Use zgrep to grep a gzip (gz) file</title><content type='html'>&lt;h2&gt;Problem&lt;/h2&gt; &lt;p&gt;You want to grep a text file that has been compressed with &lt;code&gt;gzip&lt;/code&gt;. You typically use the following steps to grep a gzip'd file, but you know there must be a better way:&lt;/p&gt; &lt;pre&gt;gunzip myfile.gz&lt;br /&gt;grep foo myfile&lt;br /&gt;gzip myfile&lt;br /&gt;&lt;/pre&gt; &lt;h2&gt;Solution - zgrep&lt;/h2&gt; &lt;p&gt;Unix and Linux systems come with a modified version of &lt;code&gt;grep&lt;/code&gt; named &lt;code&gt;&lt;b&gt;z&lt;/b&gt;grep&lt;/code&gt;. The Linux zgrep command works just like the grep command, except it works on text files that have been compressed with the gzip command.&lt;/p&gt; &lt;p&gt;This means that instead of following the three-step process shown above, you can just use zgrep to search a compressed text file in one step, like this:&lt;/p&gt; &lt;pre&gt;zgrep foo myfile.gz&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;As another example, the zgrep command also works great on compressed Apache log files. For instance, if I want to see the hits on this blog in a gzip'd Apache log file, I'd use a zgrep command like this:&lt;/p&gt; &lt;pre&gt;zgrep 'GET /blog' access_log.gz&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;or more likely I'd pipe the output into the Linux more command, like this:&lt;/p&gt; &lt;pre&gt;zgrep 'GET /blog' access_log.gz | more&lt;br /&gt;As you can see, using the zgrep command is much easier than using the&lt;br /&gt;three-step gunzip/grep gzip command I showed at the beginning of this&lt;br /&gt;article.&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7517427329637873814-8573527444246149772?l=fahadnct.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fahadnct.blogspot.com/feeds/8573527444246149772/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://fahadnct.blogspot.com/2010/03/use-zgrep-to-grep-gzip-gz-file.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/8573527444246149772'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/8573527444246149772'/><link rel='alternate' type='text/html' href='http://fahadnct.blogspot.com/2010/03/use-zgrep-to-grep-gzip-gz-file.html' title='Use zgrep to grep a gzip (gz) file'/><author><name>fahad syamlan</name><uri>http://www.blogger.com/profile/06708957413852542769</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7517427329637873814.post-4934932018239047497</id><published>2010-03-02T04:47:00.000-08:00</published><updated>2010-03-02T04:48:03.163-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>How to use Linux command line mail to email a file</title><content type='html'>&lt;p&gt;If you're ever working on a Unix or Linux system, and need to email a file to someone else, it may be helpful to know that you can send your email message right from the Unix command line. You don't need to hop into mutt or any other Unix or Linux mail client to email the file.&lt;/p&gt;  &lt;p&gt;Here's a simple one-line example where I use the Unix/Linux mail command to email a file to the email address "kim@example.com". In this example, the subject of the message is "Some important information", and the file I'm attaching is named &lt;code&gt;ImportantFile.txt&lt;/code&gt;:&lt;/p&gt; &lt;pre&gt;mail -s "Some important information" &lt;a href="mailto:kim@example.com"&gt;kim@example.com&lt;/a&gt; &lt; ImportantFile.txt&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;Assuming all your email plumbing infrastructure is set up properly, the email message will appear to the recipient as though it came from your current user account on the Unix or Linux system you're sending the message from. If your email infrastructure isn't set up right ... I suppose that's a subject for a much longer tutorial, lol.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7517427329637873814-4934932018239047497?l=fahadnct.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fahadnct.blogspot.com/feeds/4934932018239047497/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://fahadnct.blogspot.com/2010/03/how-to-use-linux-command-line-mail-to.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/4934932018239047497'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/4934932018239047497'/><link rel='alternate' type='text/html' href='http://fahadnct.blogspot.com/2010/03/how-to-use-linux-command-line-mail-to.html' title='How to use Linux command line mail to email a file'/><author><name>fahad syamlan</name><uri>http://www.blogger.com/profile/06708957413852542769</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7517427329637873814.post-1743278804803571307</id><published>2010-03-02T04:44:00.000-08:00</published><updated>2010-03-02T04:46:39.855-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>UNIX / Linux Command Summary</title><content type='html'>&lt;p&gt;&lt;strong&gt;access()&lt;/strong&gt;&lt;br /&gt; Used to check the accessibility of files&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;int&lt;/strong&gt;&lt;br /&gt; Access(pathname, access_mode)&lt;br /&gt; Char* pathname;&lt;br /&gt; int access-mode;&lt;br /&gt; The access modes are.&lt;br /&gt; 04 read&lt;br /&gt; 02 write&lt;br /&gt; 01 execute (search)&lt;br /&gt; 00 checks existence of a file &lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;&amp;amp; operator&lt;/strong&gt;&lt;br /&gt; execute a command as a background process.&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;banner&lt;/strong&gt;&lt;br /&gt; prints the specified string in large letters. Each argument may be upto 10 characters long.&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;break&lt;/strong&gt;&lt;br /&gt; is used to break out of a loop. It does not exit from the program.&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;Cal&lt;/strong&gt;&lt;br /&gt;Produces a calender of the current month as standard output. The month (1-12) and year (1-9999) must be specified in full numeric format.&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;Cal&lt;/strong&gt; [[ month] year]&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;Calendar&lt;/strong&gt;&lt;br /&gt; Displays contents of the calendar file&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;case operator &lt;/strong&gt;&lt;br /&gt; The case operator is used to validate multiple conditions.&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;Case $string in&lt;/strong&gt;&lt;/p&gt;                                           &lt;p&gt; Pattern 1)&lt;br /&gt; Command list;;&lt;br /&gt; Command list;;&lt;/p&gt;                                           &lt;p&gt; Pattern 3)&lt;br /&gt; Command list;;&lt;br /&gt; easc&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;cat&lt;/strong&gt;&lt;br /&gt;(for concatenate) command is used to display the contents of a file. Used without arguments it takes input from standard input &lt;dtrl&gt; is used to terminate input.&lt;/dtrl&gt;&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;cat [filename(s)]&lt;br /&gt;                                           &lt;/strong&gt;cat &gt; [filename]&lt;br /&gt; Data can be appended to a file using &gt;&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Some of the available options are :&lt;br /&gt;                                           &lt;/strong&gt;Cat [-options] filename(S)&lt;br /&gt; -s silent about files that&lt;br /&gt; cannot be accessed&lt;br /&gt; -v enables display of non printinging characters (except tabs, new lines, form-&lt;/p&gt;                                           &lt;p&gt; &lt;strong&gt;feeds)&lt;br /&gt;                                           &lt;/strong&gt;-t when used with –v, it causes tabs to be printed as ^I’s&lt;br /&gt; -e when used with –v, it causes $ to be printed at the end of each line&lt;br /&gt; The –t and –e options are ignored if the –v options is not specified.&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;cd&lt;/strong&gt;&lt;br /&gt; Used to change directories&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;chgrp&lt;/strong&gt;&lt;br /&gt; Changes the group that owns a file.&lt;br /&gt; Chgrp [grou –id] [filename]&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;chmod&lt;/strong&gt;&lt;br /&gt; Allows file permissions to be changed for each user. File permissions can be changed only by the owner (s).&lt;br /&gt; Chmod [+/-][rwx] [ugo] [filename]&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;chown&lt;/strong&gt;&lt;br /&gt; Used to change the owner of a file.&lt;br /&gt; The command takes a file(s) as source files and the login id of another user as the target.&lt;br /&gt; Chown [user-id] [filename]&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;cmp&lt;/strong&gt;&lt;br /&gt; The cmp command compares two files (text or binary) byte-by-byte and displays the first occurrence where the files differ.&lt;br /&gt; Cmp [filename1] [filename2] -1 gives a long listing&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;comm.&lt;/strong&gt;&lt;br /&gt;The comm command compares two sorted files and displays the instances that are common. The display is separated into 3 columns.&lt;br /&gt; Comm. filename1 filename2&lt;br /&gt; first displays what occurs in first files but not in the second&lt;br /&gt; second displays what occurs in second file but not in first&lt;br /&gt; third displays what is common in both files&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;continue statement&lt;/strong&gt;&lt;br /&gt; The rest of the commands in the loop are ignored. It moves out of the loop and moves on the next cycle.&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;cp&lt;/strong&gt;&lt;br /&gt; The cp (copy) command is used to copy a file.&lt;br /&gt; Cp [filename1] [filename2]&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;cpio(copy input/output)&lt;/strong&gt;&lt;br /&gt; Utility program used to take backups.&lt;br /&gt; Cpio operates in three modes:&lt;br /&gt; -o output&lt;br /&gt; -i input&lt;br /&gt; -p pass&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;creat()&lt;br /&gt;                                           &lt;/strong&gt;the system call creates a new file or prepares to rewrite an existing file. The file pointer is set to the beginning of file.&lt;br /&gt; #include&lt;sys h=""&gt;&lt;br /&gt; #include&lt;sys h=""&gt;&lt;br /&gt; int creat(path, mode)&lt;/sys&gt;&lt;/sys&gt;&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;char *path;&lt;br /&gt;                                         &lt;/strong&gt;int mode;&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;cut&lt;/strong&gt;&lt;br /&gt;used to cut out parts of a file. It takes filenames as command line arguments or input from standard input. The command can cut columns as well as fields in a file. It however does not delete the selected parts of the file.&lt;br /&gt; Cut [-ef] [column/fie,d] filename&lt;br /&gt; Cut-d “:” –f1,2,3 filename&lt;br /&gt; Where –d indicates a delimiter specified within “:”&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;df&lt;/strong&gt;&lt;br /&gt; used to find the number of free blocks available for all the mounted file systems.&lt;br /&gt; #/etc/df [filesystem]&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;diff&lt;/strong&gt;&lt;br /&gt;the diff command compares text files. It gives an index of all the lines that differ in the two files along with the line numbers. It also displays what needs to be changed.&lt;br /&gt; Diff filename1 filename2&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;echo&lt;/strong&gt;&lt;br /&gt; The echo command echoes arguments on the command line.&lt;br /&gt; echo [arguments]&lt;br /&gt;&lt;br /&gt; &lt;strong&gt; env&lt;/strong&gt;&lt;br /&gt; Displays the permanent environment variables associated with a user’s login id&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;exit command&lt;/strong&gt;&lt;br /&gt; Used to stop the execution of a shell script.&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;expr command&lt;/strong&gt;&lt;br /&gt; Expr (command) command is used for numeric computation.&lt;br /&gt;The operators + (add), -(subtract), *(multiplu), /(divide), (remainder) are allowed. Calculation are performed in order of normal numeric precedence.&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;find&lt;/strong&gt;&lt;br /&gt;The find command searches through directories for files that match the specified criteria. It can take full pathnames and relative pathnames on the command line.&lt;br /&gt; To display the output on screen the –print option must be specified&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;for operator&lt;/strong&gt;&lt;br /&gt; The for operator may be used in looping constructs where there is repetitive execution of a section of the shell program.&lt;br /&gt; For var in vall val2 val3 val4;&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;Do commnds; done&lt;/strong&gt;&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;fsck&lt;/strong&gt;&lt;br /&gt; Used to check the file system and repair damaged files. The command takes a device name as an argument&lt;br /&gt; # /etc/fsck /dev/file-system-to-be-checked.&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;grave operator&lt;/strong&gt;&lt;br /&gt; Used to store the standard the output of a command in an enviroment variable. (‘)&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;grep&lt;/strong&gt;&lt;br /&gt;The grep (global regular expression and print) command can be used as a filter to search for strings in files. The pattern may be either a fixed character string or a regular expression.&lt;br /&gt; Grep “string” filename(s)&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;HOME&lt;/strong&gt;&lt;br /&gt; User’s home directory&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;if operator&lt;/strong&gt;&lt;br /&gt; The if operator allows conditional operator&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;If expression; then commands; fi&lt;br /&gt;                                           &lt;/strong&gt;if … then…else… fi&lt;br /&gt; $ if; then&lt;/p&gt;                                           &lt;p&gt; &lt;strong&gt;commands&lt;br /&gt;                                         &lt;/strong&gt;efile; then&lt;/p&gt;                                           &lt;p&gt; &lt;strong&gt;commands&lt;br /&gt;                                         &lt;/strong&gt;fi&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;kill&lt;/strong&gt;&lt;br /&gt; used to stop background processes&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;In&lt;/strong&gt;&lt;br /&gt; used to link files. A duplicate of a file is created with another name&lt;/p&gt;&lt;p&gt;&lt;strong&gt;LOGNAME&lt;/strong&gt;&lt;br /&gt;  displays user’s login name&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;ls&lt;/strong&gt;&lt;br /&gt;  Lists the files in the current directory&lt;br /&gt; &lt;br /&gt;  Some of the available options are:&lt;br /&gt;  -l gives a long listing&lt;br /&gt;  -a displays all file{including hidden files&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;lp&lt;/strong&gt;&lt;br /&gt;  used to print data on the line printer.&lt;br /&gt;  Lp [options] filename(s)&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;mesg &lt;/strong&gt;&lt;br /&gt;  The mesg command controls messages received on a terminal.&lt;br /&gt;  -n does not allow messages to be displayed on screen&lt;br /&gt;  -y allows messages to be displayed on screen&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;mkdir &lt;/strong&gt;&lt;br /&gt;  used to create directories&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;more&lt;/strong&gt;&lt;br /&gt;  The more command is used to dispay data one screenful at a time.&lt;br /&gt;  More [filename]&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;mv&lt;/strong&gt;&lt;br /&gt;Mv (move) moves a file from one directory to another or simply changes filenames. The command takes filename and pathnames as source names and a filename or exiting directory as target names.&lt;br /&gt;  mv [source-file] [target-file]&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;news&lt;/strong&gt;&lt;br /&gt;  The news command allows a user to read news items published by the system administrator.&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;ni&lt;/strong&gt;&lt;br /&gt;  Displays the contents of a file with line numbers&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;passwd&lt;/strong&gt;&lt;br /&gt;  Changes the password&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;paste&lt;/strong&gt;&lt;br /&gt;The paste command joins lines from two files and displays the output. It can take a number of filenames as command line arguments.&lt;br /&gt;  paste file1 file2&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;PATH&lt;/strong&gt;&lt;br /&gt;  The directories that the system searches to find commands&lt;br /&gt;                                       &lt;br /&gt;                                        &lt;strong&gt; pg &lt;/strong&gt;&lt;br /&gt;  Used to display data one page (screenful) at a time. The command can take a number of filenames as arguments.&lt;br /&gt;  Pg [option] [filename] [filename2]…..&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;pipe&lt;/strong&gt;&lt;br /&gt;  Operator (1) takes the output of one commands as input of another command.&lt;br /&gt;                                       &lt;br /&gt;                                        &lt;strong&gt; ps&lt;/strong&gt;&lt;br /&gt;  Gives information about all the active processes.&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;PS1&lt;br /&gt;                                          &lt;/strong&gt;The system prompt&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;pwd&lt;/strong&gt;&lt;br /&gt;  (print working directory) displays the current directory.&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;rm&lt;/strong&gt;&lt;br /&gt;The rm (remove) command is used to delete files from a directory. A number of files may be deleted simultaneously. A file(s) once deleted cannot be retrieved.&lt;br /&gt;  rm [filename 1] [filename 2]…&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;sift command &lt;/strong&gt;&lt;br /&gt;  Using shift $1becomes the source string and other arguments are shifted. $2 is shifted to $1,$3to $2 and so on.&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;Sleep&lt;/strong&gt;&lt;br /&gt;  The sleep command is used to suspend the execution of a shell script for the specified time. This is usually in seconds.&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;sort&lt;/strong&gt;&lt;br /&gt;  Sort is a utility program that can be used to sort text files in numeric or alphabetical order&lt;br /&gt;  Sort [filename]&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;split&lt;/strong&gt;&lt;br /&gt;  Used to split large file into smaller files&lt;br /&gt;  Split-n filename&lt;br /&gt;  Split can take a second filename on the command line.&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;su&lt;/strong&gt;&lt;br /&gt;  Used to switch to superuser or any other user.&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;sync&lt;/strong&gt;&lt;br /&gt;  Used to copy data in buffers to files&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;system0&lt;/strong&gt;&lt;br /&gt;  Used to run a UNIX command from within a C program&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;tail&lt;/strong&gt;&lt;br /&gt;  The tail command may be used to view the end of a file.&lt;br /&gt;  Tail [filename]&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;tar &lt;/strong&gt;&lt;br /&gt;  Used to save and restore files to tapes or other removable media.&lt;br /&gt;  Tar [function[modifier]] [filename(s)]&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;tee&lt;/strong&gt;&lt;br /&gt;  output that is being redirected to a file can also be viewed on standard output.&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;test command &lt;/strong&gt;&lt;br /&gt;  It compares strings and numeric values.&lt;br /&gt;  The test command has two forms : test command itself If test ${variable} = value then&lt;br /&gt;  Do commands else do commands&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;File&lt;/strong&gt;&lt;br /&gt;The test commands also uses special operators [ ]. These are operators following the of are interpreted by the shell as different from wildcard characters.&lt;br /&gt;  Of [ -f ${variable} ]&lt;/p&gt;&lt;p&gt; &lt;strong&gt;Then&lt;br /&gt;                                            &lt;/strong&gt;Do commands&lt;br /&gt;  Elif&lt;br /&gt;  [ -d ${variable} ]&lt;/p&gt;                                           &lt;p&gt; &lt;strong&gt;then&lt;br /&gt;                                          &lt;/strong&gt;do commands&lt;/p&gt;                                           &lt;p&gt; &lt;strong&gt;else&lt;br /&gt;                                          &lt;/strong&gt;do commands&lt;/p&gt;                                           &lt;p&gt; &lt;strong&gt;fi&lt;br /&gt;                                            &lt;/strong&gt;many different tests are possible for files. Comparing numbers, character strings, values of environment variables.&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;time&lt;/strong&gt;&lt;br /&gt;  Used to display the execution time of a program or a command. Time is reported in seconds.&lt;br /&gt;  Time filename values&lt;strong&gt;&lt;br /&gt;  &lt;/strong&gt;&lt;br /&gt;  &lt;strong&gt; tr&lt;/strong&gt;&lt;br /&gt;  The tr command is used to translate characters.&lt;br /&gt;  tr [-option] [string1 [string2]]&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;tty &lt;/strong&gt;&lt;br /&gt;  Displays the terminal pathname&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;umask&lt;/strong&gt;&lt;br /&gt;  Used to specify default permissions while creating files.&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;uniq &lt;/strong&gt;&lt;br /&gt;  The uniq command is used to display the uniq(ue) lines in a sorted file.&lt;br /&gt;  Sort filename uniq&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;until&lt;/strong&gt;&lt;br /&gt;  The operator executes the commands within a loop as long as the test condition is false.&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;wall&lt;/strong&gt;&lt;br /&gt;  Used to send a message to all users logged in.&lt;br /&gt;  # /etc/wall message&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;wait &lt;/strong&gt;&lt;br /&gt;  the command halts the execution of a script until all child processes, executed as background processes, are completed.&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;wc&lt;/strong&gt;&lt;br /&gt;  The wc command can be used to count the number of lines, words and characters in a fine.&lt;br /&gt;  wc [filename(s)]&lt;br /&gt;  &lt;strong&gt;The available options are: &lt;/strong&gt;&lt;br /&gt;  wc –[options] [filename]&lt;br /&gt;  -1&lt;br /&gt;  -w&lt;br /&gt;  -c&lt;br /&gt;  while operator&lt;br /&gt;  the while operator repeatedly performs an operation until the test condition proves false.&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;$ while&lt;br /&gt;                                          &lt;/strong&gt;Ø do&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;commands&lt;br /&gt;                                          &lt;/strong&gt;Ø done&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;who &lt;/strong&gt;&lt;br /&gt;displays information about all the users currently logged onto the system. The user name, terminal number and the date and time that each user logged onto the system.&lt;br /&gt;  The syntax of the who command is who [options]&lt;/p&gt;                                           &lt;p&gt;&lt;strong&gt;write&lt;/strong&gt;&lt;br /&gt;The write command allows inter-user communication. A user can send messages by addressing the other user’s terminal or login id.&lt;br /&gt;  write user-name [terminal number]&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7517427329637873814-1743278804803571307?l=fahadnct.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fahadnct.blogspot.com/feeds/1743278804803571307/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://fahadnct.blogspot.com/2010/03/unix-linux-command-summary.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/1743278804803571307'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/1743278804803571307'/><link rel='alternate' type='text/html' href='http://fahadnct.blogspot.com/2010/03/unix-linux-command-summary.html' title='UNIX / Linux Command Summary'/><author><name>fahad syamlan</name><uri>http://www.blogger.com/profile/06708957413852542769</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7517427329637873814.post-5138684565998832397</id><published>2010-03-02T04:36:00.000-08:00</published><updated>2010-03-02T04:44:18.897-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Linux wget command - how to download files</title><content type='html'>&lt;p&gt;Suppose you're working on a Unix or Linux machine remotely through an SSH session, and then you need to get a resource (like a tar or gzip file) that's on the Internet over to that machine. You could download that file to your local machine, and then use &lt;code&gt;scp&lt;/code&gt; to copy it to your remote Unix box, but that's a lot of work. A better way to get that file onto your remote server is to use the &lt;em&gt;Linux wget&lt;/em&gt; command from that server, and download that resource directly to your remote server. In this wget tutorial I'll demonstrate how to do this.&lt;/p&gt; &lt;h2&gt;A Linux wget download example&lt;/h2&gt; &lt;p&gt;I just ran into this situation myself, where I just wanted to get a Ruby resource onto a Linux workstation I was logged into using ssh. (My particular problem is that it takes to ssh logins to get to my remote server.) To make life easier, I just followed these steps to use wget on my remote server to download the resource I needed on that system:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;On my local Windows workstation I searched the internet until I found the need URL I needed, which in this case was "http://tmtm.org/downloads/mysql/ruby/mysql-ruby-2.7.1.tar.gz".&lt;/li&gt;&lt;li&gt;In my SSH terminal (where I was logged into my remote server) I typed this Linux wget command:&lt;/li&gt;&lt;/ul&gt; &lt;pre&gt;wget &lt;a href="http://tmtm.org/downloads/mysql/ruby/mysql-ruby-2.7.1.tar.gz" title="http://tmtm.org/downloads/mysql/ruby/mysql-ruby-2.7.1.tar.gz"&gt;http://tmtm.org/downloads/mysql/ruby/mysql-ruby-2.7.1.tar.gz&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;As soon as the wget download was complete, I had the file I needed on my remote server, with no need for the etxra &lt;code&gt;scp&lt;/code&gt; step.&lt;/p&gt; &lt;p&gt;One thing to know is that this will leave a record in the remote system's access log files, showing the hit coming from the remote system where you ran the &lt;code&gt;wget&lt;/code&gt; command. I don't think that is really a problem, but I thought I should mention it.&lt;/p&gt; &lt;p&gt;I should also note that you can use &lt;code&gt;w3m&lt;/code&gt; on the remote machine as well. I just can't use that as fast as I can use a GUI browser, like Firefox.&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7517427329637873814-5138684565998832397?l=fahadnct.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fahadnct.blogspot.com/feeds/5138684565998832397/comments/default' title='Poskan Komentar'/><link rel='replies' type='text/html' href='http://fahadnct.blogspot.com/2010/03/linux-wget-command-how-to-download.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/5138684565998832397'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7517427329637873814/posts/default/5138684565998832397'/><link rel='alternate' type='text/html' href='http://fahadnct.blogspot.com/2010/03/linux-wget-command-how-to-download.html' title='Linux wget command - how to download files'/><author><name>fahad syamlan</name><uri>http://www.blogger.com/profile/06708957413852542769</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
