<?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>Komentarze do: cmd.exe for Linux zealots</title>
	<atom:link href="http://polishlinux.org/apps/cli/cmdexe-for-linux-zealots/feed/" rel="self" type="application/rss+xml" />
	<link>http://polishlinux.org/apps/cli/cmdexe-for-linux-zealots/</link>
	<description>All About GNU/Linux and BSD - reviews, comparisons, articles</description>
	<lastBuildDate>Sun, 05 Feb 2012 02:17:53 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>Autor: Evan</title>
		<link>http://polishlinux.org/apps/cli/cmdexe-for-linux-zealots/#comment-132911</link>
		<dc:creator>Evan</dc:creator>
		<pubDate>Fri, 15 Jan 2010 22:41:25 +0000</pubDate>
		<guid isPermaLink="false">http://polishlinux.org/apps/cli/cmdexe-for-linux-zealots/#comment-132911</guid>
		<description>Those commands aren&#039;t *quite* the same; Goten&#039;s only shows .flac files one level down.

That said, it does lead into another &quot;classic example&quot; of how Bash can (only occasionally, but definitely occasionally) be harder to use: list all .flac files in *any* subdirectory of where you are now, not just one level down.

In cmd, it&#039;s easy; &#039;dir /s *.flac&#039; as John said. In Bash... well, until recently, you have to use find. &#039;find . -name &quot;*.flac&quot;&#039;. find is one of those utilities that is not exactly easy to learn to use... even for simple queries like that, for a while I was using &#039;find . &#124; grep &quot;.flac&quot;&#039;.

In other words, you had to completely change the program you&#039;re calling. ls can list files by pattern (&#039;ls *.flac&#039;), and ls can list a directory recursively (&#039;ls -R&#039;), but you can&#039;t combine the two tasks with ls itself. (Of course the reason is that it wasn&#039;t really ls that was listing files by pattern, it was the shell.)

A similar thing comes up with the following task: search through all .c files in a subdirectory of the current one for a particular string &quot;foo&quot;. In Bash: &#039;find -name &quot;*.c&quot; -print0 &#124; xargs -0 grep -H foo&#039;. (You could also do the same thing with {}, but I never remember how to use that syntax.) There&#039;s a bunch of different gotchas in that. In addition to figuring out the general idea in the first place, if you leave off the -print0 and -0, file names with spaces will cause it to fail. If you leave off the -H, you&#039;ll see matching lines, but you&#039;ll have no idea what file they&#039;re in. In Windows, &#039;findstr /s REACHABLE *.c&#039;. The only thing additional you have to do to make the search recursive is add /s.

(GNU grep contains the &#039;--include&#039; flag; paired with --recursive is the *right* way to do this search now. However, this is a relatively recent addition.)

You get used to this after a while -- recursive queries take find -- but for a newcomer, it can be hard for a while.

(Finally, Bash 4 introduced the ** feature which mostly obviates my immediate arguments above. &#039;ls **/*.flac&#039; and &#039;grep foo **/*.c&#039; now do what you want, as long as you don&#039;t overrun the command line length. (OTOH, this *is* sometimes a real problem.) However, this is a *very* recent addition to Bash, with Bash 4 being less than a year old. Zsh has had it for longer, but no one uses it for some reason despite it kicking the pants off of Bash.)</description>
		<content:encoded><![CDATA[<p>Those commands aren&#8217;t *quite* the same; Goten&#8217;s only shows .flac files one level down.</p>
<p>That said, it does lead into another &#8222;classic example&#8221; of how Bash can (only occasionally, but definitely occasionally) be harder to use: list all .flac files in *any* subdirectory of where you are now, not just one level down.</p>
<p>In cmd, it&#8217;s easy; &#8216;dir /s *.flac&#8217; as John said. In Bash&#8230; well, until recently, you have to use find. &#8216;find . -name &#8222;*.flac&#8221;&#8216;. find is one of those utilities that is not exactly easy to learn to use&#8230; even for simple queries like that, for a while I was using &#8216;find . | grep &#8222;.flac&#8221;&#8216;.</p>
<p>In other words, you had to completely change the program you&#8217;re calling. ls can list files by pattern (&#8216;ls *.flac&#8217;), and ls can list a directory recursively (&#8216;ls -R&#8217;), but you can&#8217;t combine the two tasks with ls itself. (Of course the reason is that it wasn&#8217;t really ls that was listing files by pattern, it was the shell.)</p>
<p>A similar thing comes up with the following task: search through all .c files in a subdirectory of the current one for a particular string &#8222;foo&#8221;. In Bash: &#8216;find -name &#8222;*.c&#8221; -print0 | xargs -0 grep -H foo&#8217;. (You could also do the same thing with {}, but I never remember how to use that syntax.) There&#8217;s a bunch of different gotchas in that. In addition to figuring out the general idea in the first place, if you leave off the -print0 and -0, file names with spaces will cause it to fail. If you leave off the -H, you&#8217;ll see matching lines, but you&#8217;ll have no idea what file they&#8217;re in. In Windows, &#8216;findstr /s REACHABLE *.c&#8217;. The only thing additional you have to do to make the search recursive is add /s.</p>
<p>(GNU grep contains the &#8216;&#8211;include&#8217; flag; paired with &#8211;recursive is the *right* way to do this search now. However, this is a relatively recent addition.)</p>
<p>You get used to this after a while &#8212; recursive queries take find &#8212; but for a newcomer, it can be hard for a while.</p>
<p>(Finally, Bash 4 introduced the ** feature which mostly obviates my immediate arguments above. &#8216;ls **/*.flac&#8217; and &#8216;grep foo **/*.c&#8217; now do what you want, as long as you don&#8217;t overrun the command line length. (OTOH, this *is* sometimes a real problem.) However, this is a *very* recent addition to Bash, with Bash 4 being less than a year old. Zsh has had it for longer, but no one uses it for some reason despite it kicking the pants off of Bash.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Autor: John</title>
		<link>http://polishlinux.org/apps/cli/cmdexe-for-linux-zealots/#comment-124456</link>
		<dc:creator>John</dc:creator>
		<pubDate>Tue, 23 Sep 2008 11:45:52 +0000</pubDate>
		<guid isPermaLink="false">http://polishlinux.org/apps/cli/cmdexe-for-linux-zealots/#comment-124456</guid>
		<description>Goten Xiao: Try the /S flag
from dir /?:
/S          Displays files in specified directory and all subdirectories.

Try 
dir /s *.flac
dir /s /b *.flac 
will keep it from showing file size, etc.</description>
		<content:encoded><![CDATA[<p>Goten Xiao: Try the /S flag<br />
from dir /?:<br />
/S          Displays files in specified directory and all subdirectories.</p>
<p>Try<br />
dir /s *.flac<br />
dir /s /b *.flac<br />
will keep it from showing file size, etc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Autor: Goten Xiao</title>
		<link>http://polishlinux.org/apps/cli/cmdexe-for-linux-zealots/#comment-121573</link>
		<dc:creator>Goten Xiao</dc:creator>
		<pubDate>Fri, 30 May 2008 13:12:20 +0000</pubDate>
		<guid isPermaLink="false">http://polishlinux.org/apps/cli/cmdexe-for-linux-zealots/#comment-121573</guid>
		<description>A classic example of why cmd is unusable; of why it is a toy, and why I can&#039;t use it efficiently compared to bash, zsh, tcsh or ksh.

&lt;blockquote&gt;
G:\music&gt;dir/w
 Volume in drive G has no label.
 Volume Serial Number is 4786-4F2F

 Directory of G:\music

[.]                                             [..]
[{2005} Octavarium [FLAC]]                      [{2002} Six Degrees of Inner Turbulence [FLAC]]
[misc]
               0 File(s)              0 bytes
               5 Dir(s)     694,267,904 bytes free

G:\music&gt;dir *\*.flac
The filename, directory name, or volume label syntax is incorrect.
&lt;/blockquote&gt;

Now, compare and contrast to the equivalent in bash:
&lt;blockquote&gt;
goten@r2d3:~/tmp15$ ls
{2002} Six Degrees of Inner Turbulence [FLAC]  {2005} Octavarium [FLAC]  misc
goten@r2d3:~/tmp15$ ls */*.flac
{2002} Six Degrees of Inner Turbulence [FLAC]/[Â°1] The Glass Prison.flac  {2005} Octavarium [FLAC]/[03] These Walls.flac
{2002} Six Degrees of Inner Turbulence [FLAC]/[Â°2] Blind Faith.flac       {2005} Octavarium [FLAC]/[04] I Walk Beside You.flac
{2002} Six Degrees of Inner Turbulence [FLAC]/[Â°3] Misunderstood.flac     {2005} Octavarium [FLAC]/[05] Panic Attack.flac
{2002} Six Degrees of Inner Turbulence [FLAC]/[Â°4] The Great Debate.flac  {2005} Octavarium [FLAC]/[06] Never Enough.flac
{2002} Six Degrees of Inner Turbulence [FLAC]/[Â°5] Disappear.flac         {2005} Octavarium [FLAC]/[07] Sacrificed Sons.flac
{2005} Octavarium [FLAC]/[01] The Root of All Evil.flac                   {2005} Octavarium [FLAC]/[08] Octavarium.flac
{2005} Octavarium [FLAC]/[02] The Answer Lies Within.flac
&lt;/blockquote&gt;</description>
		<content:encoded><![CDATA[<p>A classic example of why cmd is unusable; of why it is a toy, and why I can&#8217;t use it efficiently compared to bash, zsh, tcsh or ksh.</p>
<blockquote><p>
G:\music&gt;dir/w<br />
 Volume in drive G has no label.<br />
 Volume Serial Number is 4786-4F2F</p>
<p> Directory of G:\music</p>
<p>[.]                                             [..]<br />
[{2005} Octavarium [FLAC]]                      [{2002} Six Degrees of Inner Turbulence [FLAC]]<br />
[misc]<br />
               0 File(s)              0 bytes<br />
               5 Dir(s)     694,267,904 bytes free</p>
<p>G:\music&gt;dir *\*.flac<br />
The filename, directory name, or volume label syntax is incorrect.
</p></blockquote>
<p>Now, compare and contrast to the equivalent in bash:</p>
<blockquote><p>
goten@r2d3:~/tmp15$ ls<br />
{2002} Six Degrees of Inner Turbulence [FLAC]  {2005} Octavarium [FLAC]  misc<br />
goten@r2d3:~/tmp15$ ls */*.flac<br />
{2002} Six Degrees of Inner Turbulence [FLAC]/[Â°1] The Glass Prison.flac  {2005} Octavarium [FLAC]/[03] These Walls.flac<br />
{2002} Six Degrees of Inner Turbulence [FLAC]/[Â°2] Blind Faith.flac       {2005} Octavarium [FLAC]/[04] I Walk Beside You.flac<br />
{2002} Six Degrees of Inner Turbulence [FLAC]/[Â°3] Misunderstood.flac     {2005} Octavarium [FLAC]/[05] Panic Attack.flac<br />
{2002} Six Degrees of Inner Turbulence [FLAC]/[Â°4] The Great Debate.flac  {2005} Octavarium [FLAC]/[06] Never Enough.flac<br />
{2002} Six Degrees of Inner Turbulence [FLAC]/[Â°5] Disappear.flac         {2005} Octavarium [FLAC]/[07] Sacrificed Sons.flac<br />
{2005} Octavarium [FLAC]/[01] The Root of All Evil.flac                   {2005} Octavarium [FLAC]/[08] Octavarium.flac<br />
{2005} Octavarium [FLAC]/[02] The Answer Lies Within.flac
</p></blockquote>
]]></content:encoded>
	</item>
	<item>
		<title>Autor: Sanders MSMVP</title>
		<link>http://polishlinux.org/apps/cli/cmdexe-for-linux-zealots/#comment-119750</link>
		<dc:creator>Sanders MSMVP</dc:creator>
		<pubDate>Sun, 13 Apr 2008 23:48:58 +0000</pubDate>
		<guid isPermaLink="false">http://polishlinux.org/apps/cli/cmdexe-for-linux-zealots/#comment-119750</guid>
		<description>Anyone who has worked on both operating systems will release Sanders is talking out of his arse.  You don&#039;t &quot;upgrade the entire operating system to upgrade open office&quot; nor any other program on it.  Unless you are either using a very, very, very old version of Linux or are being paid to spread pure lies.

Second, Linux can use Windows domains quite easily and act as a domain controller itself.  Please, if you are going to be a paid shill at least be honest and upfront.</description>
		<content:encoded><![CDATA[<p>Anyone who has worked on both operating systems will release Sanders is talking out of his arse.  You don&#8217;t &#8222;upgrade the entire operating system to upgrade open office&#8221; nor any other program on it.  Unless you are either using a very, very, very old version of Linux or are being paid to spread pure lies.</p>
<p>Second, Linux can use Windows domains quite easily and act as a domain controller itself.  Please, if you are going to be a paid shill at least be honest and upfront.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Autor: Tzafrir Cohen</title>
		<link>http://polishlinux.org/apps/cli/cmdexe-for-linux-zealots/#comment-119734</link>
		<dc:creator>Tzafrir Cohen</dc:creator>
		<pubDate>Sun, 13 Apr 2008 15:57:15 +0000</pubDate>
		<guid isPermaLink="false">http://polishlinux.org/apps/cli/cmdexe-for-linux-zealots/#comment-119734</guid>
		<description>One baisc weakness of cmd.exe&#039;s syntax is the variable expansion is different in scripts than in the CLI (%% vs. %).

Not to mention backticks, decent redirection (2&gt;/dev/null), and such.

The author manages to completely miss the point regarding package management. For example: what is the equivalent of &#039;apt-get upgrade&#039;?  

Maybe the Windows-Updates facility has been automated (and maybe not). But it does not update any thinrd-party product installed. Because without a repository the system does not know where to pull updates from.

Now do that on 100 workstations.</description>
		<content:encoded><![CDATA[<p>One baisc weakness of cmd.exe&#8217;s syntax is the variable expansion is different in scripts than in the CLI (%% vs. %).</p>
<p>Not to mention backticks, decent redirection (2&gt;/dev/null), and such.</p>
<p>The author manages to completely miss the point regarding package management. For example: what is the equivalent of &#8216;apt-get upgrade&#8217;?  </p>
<p>Maybe the Windows-Updates facility has been automated (and maybe not). But it does not update any thinrd-party product installed. Because without a repository the system does not know where to pull updates from.</p>
<p>Now do that on 100 workstations.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Autor: Peter Ring</title>
		<link>http://polishlinux.org/apps/cli/cmdexe-for-linux-zealots/#comment-119730</link>
		<dc:creator>Peter Ring</dc:creator>
		<pubDate>Sun, 13 Apr 2008 11:32:00 +0000</pubDate>
		<guid isPermaLink="false">http://polishlinux.org/apps/cli/cmdexe-for-linux-zealots/#comment-119730</guid>
		<description>PowerShell is worthwhile for all kinds of automation on Windows, comes built-in with Windows Server 2008, and is easily installed on Windows XP SP2 or later.

&lt;a href=&quot;http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx&quot; rel=&quot;nofollow&quot;&gt;Windows PowerShell&lt;/a&gt;

&lt;a href=&quot;http://blogs.msdn.com/PowerShell/&quot; rel=&quot;nofollow&quot;&gt;Blog of Windows PowerShell team&lt;/a&gt;

I&#039;d also like to mention a hidden gem, &lt;a href=&quot;http://www.microsoft.com/technet/scriptcenter/tools/logparser/default.mspx&quot; rel=&quot;nofollow&quot;&gt;LogParser&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>PowerShell is worthwhile for all kinds of automation on Windows, comes built-in with Windows Server 2008, and is easily installed on Windows XP SP2 or later.</p>
<p><a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx" rel="nofollow">Windows PowerShell</a></p>
<p><a href="http://blogs.msdn.com/PowerShell/" rel="nofollow">Blog of Windows PowerShell team</a></p>
<p>I&#8217;d also like to mention a hidden gem, <a href="http://www.microsoft.com/technet/scriptcenter/tools/logparser/default.mspx" rel="nofollow">LogParser</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Autor: Pandu Rao</title>
		<link>http://polishlinux.org/apps/cli/cmdexe-for-linux-zealots/#comment-119719</link>
		<dc:creator>Pandu Rao</dc:creator>
		<pubDate>Sun, 13 Apr 2008 03:50:07 +0000</pubDate>
		<guid isPermaLink="false">http://polishlinux.org/apps/cli/cmdexe-for-linux-zealots/#comment-119719</guid>
		<description>While cmd.exe is useful, it lacks many things. For e.g:
readline keybindings
command line substitution
robust redirection capabilities
advanced terminal capabilities

I have written a set of articles on how Linux power users can get by in the windows world:
Advanced Cygwin:
http://ergo.rydlr.net/?p=4

PuttyCyg - The authentic console for Cygwin
http://ergo.rydlr.net/?p=3</description>
		<content:encoded><![CDATA[<p>While cmd.exe is useful, it lacks many things. For e.g:<br />
readline keybindings<br />
command line substitution<br />
robust redirection capabilities<br />
advanced terminal capabilities</p>
<p>I have written a set of articles on how Linux power users can get by in the windows world:<br />
Advanced Cygwin:<br />
<a href="http://ergo.rydlr.net/?p=4" rel="nofollow">http://ergo.rydlr.net/?p=4</a></p>
<p>PuttyCyg &#8211; The authentic console for Cygwin<br />
<a href="http://ergo.rydlr.net/?p=3" rel="nofollow">http://ergo.rydlr.net/?p=3</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Autor: Sanders</title>
		<link>http://polishlinux.org/apps/cli/cmdexe-for-linux-zealots/#comment-119702</link>
		<dc:creator>Sanders</dc:creator>
		<pubDate>Sat, 12 Apr 2008 20:59:22 +0000</pubDate>
		<guid isPermaLink="false">http://polishlinux.org/apps/cli/cmdexe-for-linux-zealots/#comment-119702</guid>
		<description>I wish that there was an AD equivalent built-in on the Linux distros...

I know Samba 4 is coming, and I hope it does provide with tools that enable remote windows and linux boxes administration ala Windows.

I love and use linux, but IMHO even with all of its shortcomings windows does two things much better:

1) Logical network grouping/administration of the workstations/servers (sorry ssh doesn&#039;t cut it, requires far too much manual intervention to properly manage the keys)

2) More stable environment (Ie: I do not have to upgrade the whole windows system just to get a new version of openoffice installed)</description>
		<content:encoded><![CDATA[<p>I wish that there was an AD equivalent built-in on the Linux distros&#8230;</p>
<p>I know Samba 4 is coming, and I hope it does provide with tools that enable remote windows and linux boxes administration ala Windows.</p>
<p>I love and use linux, but IMHO even with all of its shortcomings windows does two things much better:</p>
<p>1) Logical network grouping/administration of the workstations/servers (sorry ssh doesn&#8217;t cut it, requires far too much manual intervention to properly manage the keys)</p>
<p>2) More stable environment (Ie: I do not have to upgrade the whole windows system just to get a new version of openoffice installed)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

