<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: Watch &#8211; A Useful Linux Command You May Have Never Heard Of</title> <atom:link href="http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/feed/" rel="self" type="application/rss+xml" /><link>http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/</link> <description>where things have nothing to do with beer - tutorials, tips, how-tos, thoughts, hacks, and other techy nonsense</description> <lastBuildDate>Sat, 19 May 2012 21:39:38 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item><title>By: Artem Russakovskii</title><link>http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/#comment-52434</link> <dc:creator>Artem Russakovskii</dc:creator> <pubDate>Tue, 13 Mar 2012 10:36:06 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/#comment-52434</guid> <description>Don&#039;t think you can do that with watch. If you want to detect file system changes, I suggest you look into lsyncd or inotify-tools.</description> <content:encoded><![CDATA[<p>Don&#039;t think you can do that with watch. If you want to detect file system changes, I suggest you look into lsyncd or inotify-tools.</p> ]]></content:encoded> </item> <item><title>By: soi</title><link>http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/#comment-52433</link> <dc:creator>soi</dc:creator> <pubDate>Tue, 13 Mar 2012 10:04:43 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/#comment-52433</guid> <description>Hi Artem,
I wonder how to have &quot;watch&quot; execute a command or an application for me after its detection of something &quot;new&quot; created or changed? For example, I issue the command $watch &#039;ls /home/user/&#039; and want to execute a script call upload.sh every time a new file created and detected by &quot;watch&quot;?
Thank you!</description> <content:encoded><![CDATA[<p>Hi Artem,</p><p>I wonder how to have &#034;watch&#034; execute a command or an application for me after its detection of something &#034;new&#034; created or changed? For example, I issue the command $watch &#039;ls /home/user/&#039; and want to execute a script call upload.sh every time a new file created and detected by &#034;watch&#034;?</p><p>Thank you!</p> ]]></content:encoded> </item> <item><title>By: Thomas</title><link>http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/#comment-51879</link> <dc:creator>Thomas</dc:creator> <pubDate>Thu, 11 Aug 2011 06:34:40 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/#comment-51879</guid> <description>Nice and useful post. When I recover data from bad HDDs, I used frequent &quot;df -h&quot; in 2 minutes interval. So I think &quot;watch -n 120 -d df -h&quot; will make me free from frequent typing. Cheers!</description> <content:encoded><![CDATA[<p>Nice and useful post. When I recover data from bad HDDs, I used frequent &#034;df -h&#034; in 2 minutes interval. So I think &#034;watch -n 120 -d df -h&#034; will make me free from frequent typing. Cheers!</p> ]]></content:encoded> </item> <item><title>By: Seabrook</title><link>http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/#comment-51370</link> <dc:creator>Seabrook</dc:creator> <pubDate>Thu, 10 Feb 2011 21:46:39 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/#comment-51370</guid> <description>Type the following:
watch &#039;tail -1 /var/log/secure &gt;&gt; /root/sechist&#039;
to create a cumulative file of the last line of the
/var/log/secure file, sampling every two seconds.
Then execute the following to see only the changes
uniq /root/sechist
Do an su command in another window to generate
some changes for this command.</description> <content:encoded><![CDATA[<p>Type the following:</p><p> watch &#039;tail -1 /var/log/secure &gt;&gt; /root/sechist&#039;</p><p>to create a cumulative file of the last line of the<br
/> /var/log/secure file, sampling every two seconds.</p><p>Then execute the following to see only the changes</p><p> uniq /root/sechist</p><p>Do an su command in another window to generate<br
/> some changes for this command.</p> ]]></content:encoded> </item> <item><title>By: Abhiram</title><link>http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/#comment-51363</link> <dc:creator>Abhiram</dc:creator> <pubDate>Sun, 06 Feb 2011 05:28:03 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/#comment-51363</guid> <description>Hi!
Am trying to redirect the o/p of the watch command to a file.
For ex -- watch -n 10 ps &gt;&gt; output.txt
This is giving the o/p in the file BUT, is adding these junk characters in addition. ALSO, it is NOT separating the outputs at different intervals. Its just mixing it all up.
Help needed to separate the outputs at diff intervals and NOT print the special characters!!
Regards</description> <content:encoded><![CDATA[<p>Hi!</p><p>Am trying to redirect the o/p of the watch command to a file.</p><p>For ex &#8212; watch -n 10 ps &gt;&gt; output.txt</p><p>This is giving the o/p in the file BUT, is adding these junk characters in addition. ALSO, it is NOT separating the outputs at different intervals. Its just mixing it all up.</p><p>Help needed to separate the outputs at diff intervals and NOT print the special characters!!</p><p>Regards</p> ]]></content:encoded> </item> <item><title>By: Kris</title><link>http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/#comment-51351</link> <dc:creator>Kris</dc:creator> <pubDate>Wed, 02 Feb 2011 15:15:29 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/#comment-51351</guid> <description>Love the reply.  I hope my comment pushes you over $999,9999.00</description> <content:encoded><![CDATA[<p>Love the reply.  I hope my comment pushes you over $999,9999.00</p> ]]></content:encoded> </item> <item><title>By: Artem Russakovskii</title><link>http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/#comment-51078</link> <dc:creator>Artem Russakovskii</dc:creator> <pubDate>Wed, 27 Oct 2010 08:52:05 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/#comment-51078</guid> <description>Thanks for stopping by and commenting on a 3-year old article, and for your kind and not at all passive aggressive wish. I am in fact working on becoming a millionaire in this exact way. Moreover, I believe this very page will push me past the $999,999.</description> <content:encoded><![CDATA[<p>Thanks for stopping by and commenting on a 3-year old article, and for your kind and not at all passive aggressive wish. I am in fact working on becoming a millionaire in this exact way. Moreover, I believe this very page will push me past the $999,999.</p> ]]></content:encoded> </item> <item><title>By: kisiel</title><link>http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/#comment-51077</link> <dc:creator>kisiel</dc:creator> <pubDate>Wed, 27 Oct 2010 08:35:16 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/#comment-51077</guid> <description>So you plan to become a millionaire without actually providing any value, as evidenced by this post, copied in haste from a man page. The best of luck with that.</description> <content:encoded><![CDATA[<p>So you plan to become a millionaire without actually providing any value, as evidenced by this post, copied in haste from a man page. The best of luck with that.</p> ]]></content:encoded> </item> <item><title>By: jlampa</title><link>http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/#comment-51076</link> <dc:creator>jlampa</dc:creator> <pubDate>Tue, 26 Oct 2010 19:12:27 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/#comment-51076</guid> <description>While watch is pretty useful, a better solution in this case would be to use inotify / incron, which is like cron, but based on filesystem events instead of a schedule.</description> <content:encoded><![CDATA[<p>While watch is pretty useful, a better solution in this case would be to use inotify / incron, which is like cron, but based on filesystem events instead of a schedule.</p> ]]></content:encoded> </item> <item><title>By: lakshmi</title><link>http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/#comment-51075</link> <dc:creator>lakshmi</dc:creator> <pubDate>Tue, 26 Oct 2010 18:29:16 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/#comment-51075</guid> <description>Learn something new everyday! Nice post.</description> <content:encoded><![CDATA[<p>Learn something new everyday! Nice post.</p> ]]></content:encoded> </item> <item><title>By: redraven</title><link>http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/#comment-51073</link> <dc:creator>redraven</dc:creator> <pubDate>Tue, 26 Oct 2010 16:27:34 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/#comment-51073</guid> <description>I use this quite frequently:
watch -n 1 -d /usr/bin/sensors</description> <content:encoded><![CDATA[<p>I use this quite frequently:<br
/> watch -n 1 -d /usr/bin/sensors</p> ]]></content:encoded> </item> <item><title>By: Spyros</title><link>http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/#comment-25363</link> <dc:creator>Spyros</dc:creator> <pubDate>Fri, 16 Oct 2009 07:48:25 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/#comment-25363</guid> <description>Actually i have heard of the command but i must admit that i have really used it :) Nice post, though !</description> <content:encoded><![CDATA[<p>Actually i have heard of the command but i must admit that i have really used it <img
src='http://beerpla.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> Nice post, though !</p> ]]></content:encoded> </item> <item><title>By: YB</title><link>http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/#comment-13778</link> <dc:creator>YB</dc:creator> <pubDate>Thu, 26 Feb 2009 14:04:16 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/#comment-13778</guid> <description>Thanks, Guy!
I was looking for a way to watch a certain part of a long output and your tailpipe solution was perfect!</description> <content:encoded><![CDATA[<p>Thanks, Guy!<br
/> I was looking for a way to watch a certain part of a long output and your tailpipe solution was perfect!</p> ]]></content:encoded> </item> <item><title>By: Guy</title><link>http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/#comment-7475</link> <dc:creator>Guy</dc:creator> <pubDate>Mon, 22 Sep 2008 10:59:59 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/#comment-7475</guid> <description>Artem,
Just pipe it out to the tail function, try this:
watch -d &#039;ls -l /usr/bin &#124; tail -n 50&#039;
Works quite well.  Now if it could only take an action when something changed, i.e., move files in a directory when we found changes to a directory.</description> <content:encoded><![CDATA[<p>Artem,<br
/> Just pipe it out to the tail function, try this:</p><p>watch -d &#039;ls -l /usr/bin | tail -n 50&#039;</p><p>Works quite well.  Now if it could only take an action when something changed, i.e., move files in a directory when we found changes to a directory.</p> ]]></content:encoded> </item> <item><title>By: Artem Russakovskii</title><link>http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/#comment-5657</link> <dc:creator>Artem Russakovskii</dc:creator> <pubDate>Thu, 24 Jul 2008 17:14:38 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/#comment-5657</guid> <description>Carlos, what I mean is, if you are trying to watch a long directory listing that doesn&#039;t fit the screen, screen would show you the top output of &#039;ls&#039; for example, not the bottom.</description> <content:encoded><![CDATA[<p>Carlos, what I mean is, if you are trying to watch a long directory listing that doesn&#039;t fit the screen, screen would show you the top output of &#039;ls&#039; for example, not the bottom.</p> ]]></content:encoded> </item> <item><title>By: Carlos from Philly</title><link>http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/#comment-5655</link> <dc:creator>Carlos from Philly</dc:creator> <pubDate>Thu, 24 Jul 2008 13:54:58 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2007/08/04/watch-a-useful-linux-command-you-may-have-never-heard-of/#comment-5655</guid> <description>Not sure what you mean by:
&quot;Now if anyone knows how to make watch print the bottom part of the command output rather than the top, please post a comment.&quot;
But using the --no-title option eliminates the:
Every 5.0s: ls   Thu Jul 24 09:53:45 2008
portion of the output, giving you only the result of the stuff in your quotes (at the specified interval and maintaining the specified options, of course).</description> <content:encoded><![CDATA[<p>Not sure what you mean by:<br
/> &#034;Now if anyone knows how to make watch print the bottom part of the command output rather than the top, please post a comment.&#034;<br
/> But using the &#8211;no-title option eliminates the:<br
/> Every 5.0s: ls   Thu Jul 24 09:53:45 2008<br
/> portion of the output, giving you only the result of the stuff in your quotes (at the specified interval and maintaining the specified options, of course).</p> ]]></content:encoded> </item> </channel> </rss>
