<?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: How To List Directories in a Directory in Unix</title>
	<atom:link href="http://www.unixtutorial.org/2008/04/how-to-list-directories-in-a-directory-in-unix/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.unixtutorial.org/2008/04/how-to-list-directories-in-a-directory-in-unix/</link>
	<description>Learn UNIX</description>
	<lastBuildDate>Sun, 29 Aug 2010 16:01:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: vovets</title>
		<link>http://www.unixtutorial.org/2008/04/how-to-list-directories-in-a-directory-in-unix/comment-page-1/#comment-5619</link>
		<dc:creator>vovets</dc:creator>
		<pubDate>Thu, 23 Jul 2009 14:03:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.unixtutorial.org/?p=44#comment-5619</guid>
		<description>2Tom: sometimes one can use -print0 primary. For example
find . -type f -name &#039;*~&#039; -print0 &#124; xargs -0 rm</description>
		<content:encoded><![CDATA[<p>2Tom: sometimes one can use -print0 primary. For example<br />
find . -type f -name '*~' -print0 | xargs -0 rm</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mr_dole</title>
		<link>http://www.unixtutorial.org/2008/04/how-to-list-directories-in-a-directory-in-unix/comment-page-1/#comment-1985</link>
		<dc:creator>mr_dole</dc:creator>
		<pubDate>Fri, 20 Feb 2009 22:45:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.unixtutorial.org/?p=44#comment-1985</guid>
		<description>For shell programming I find these three methods useful.

Example 1:  From current working directory return directory name only

$ ls -d *

bin ect kernel opt sbin tmp usr var

Example 2:  From current working directory include local directory &quot;./&quot;

$ ls -d ./*

./bin ./ect ./kernel ./opt ./sbin ./tmp ./usr ./var


Eample 3:  Provide the full path and return the directories with the full path name

$ ls -d /*

/bin /ect /kernel /opt /sbin /tmp /usr /var

$ ls -d /usr/*

/usr/bin /usr/include /usr/lib /usr/sbin

Shell programming usage example:  This should work with Bourn, Korn and Bash

==================================
parent_directory=/usr
print &quot;Parent: $parent_directory&quot;

# Get pull path for directories in $parent_directory
/bin/ls -d ${parent_directory}/* &#124;
while read child_directory; do
  print &quot;   Child: $child_directory&quot;
done
==================================

Hope this is useful..</description>
		<content:encoded><![CDATA[<p>For shell programming I find these three methods useful.</p>
<p>Example 1:  From current working directory return directory name only</p>
<p>$ ls -d *</p>
<p>bin ect kernel opt sbin tmp usr var</p>
<p>Example 2:  From current working directory include local directory "./"</p>
<p>$ ls -d ./*</p>
<p>./bin ./ect ./kernel ./opt ./sbin ./tmp ./usr ./var</p>
<p>Eample 3:  Provide the full path and return the directories with the full path name</p>
<p>$ ls -d /*</p>
<p>/bin /ect /kernel /opt /sbin /tmp /usr /var</p>
<p>$ ls -d /usr/*</p>
<p>/usr/bin /usr/include /usr/lib /usr/sbin</p>
<p>Shell programming usage example:  This should work with Bourn, Korn and Bash</p>
<p>==================================<br />
parent_directory=/usr<br />
print "Parent: $parent_directory"</p>
<p># Get pull path for directories in $parent_directory<br />
/bin/ls -d ${parent_directory}/* |<br />
while read child_directory; do<br />
  print "   Child: $child_directory"<br />
done<br />
==================================</p>
<p>Hope this is useful..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://www.unixtutorial.org/2008/04/how-to-list-directories-in-a-directory-in-unix/comment-page-1/#comment-1070</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Wed, 22 Oct 2008 07:19:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.unixtutorial.org/?p=44#comment-1070</guid>
		<description>Often the output of find is a list of files that contain nos standard characters for file names, such as spaces, apostrophes, parenthesis,.... I know it&#039;s a bad practice but sometimes a lot of files (especially, audio files) come from remote sources. So, if we haven&#039;t  renamed those files, the output of find can give unexpected results when it is directed to a pipe to be ussed by a second program.

How can we get an autput that programs understand to name files?</description>
		<content:encoded><![CDATA[<p>Often the output of find is a list of files that contain nos standard characters for file names, such as spaces, apostrophes, parenthesis,&#8230;. I know it's a bad practice but sometimes a lot of files (especially, audio files) come from remote sources. So, if we haven't  renamed those files, the output of find can give unexpected results when it is directed to a pipe to be ussed by a second program.</p>
<p>How can we get an autput that programs understand to name files?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
