<?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/"
	xmlns:series="http://unfoldingneurons.com/"
		>
<channel>
	<title>Comments on: How to: Linux or UNIX List just directories or directory names</title>
	<atom:link href="http://www.cyberciti.biz/faq/linux-list-just-directories-or-directory-names/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cyberciti.biz/faq/linux-list-just-directories-or-directory-names/</link>
	<description>Every answer asks a more beautiful question.</description>
	<lastBuildDate>Mon, 15 Mar 2010 07:00:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: newbee1</title>
		<link>http://www.cyberciti.biz/faq/linux-list-just-directories-or-directory-names/comment-page-1/#comment-46240</link>
		<dc:creator>newbee1</dc:creator>
		<pubDate>Wed, 03 Mar 2010 18:52:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/faq/how-to-list-just-directories-or-directory-names/#comment-46240</guid>
		<description>if you wanted to pull a date from the directory  to only list files from datea/timea through dateb/timeb (say March 2 at 6:00 AM to March 8 at 6:00 AM) and move into a new file the output, how is this accomplished?  I tried this but no output
#!/bin/bash
FILES=&#039;ls -A1&#039; 
OUTFILE=&quot;c:/temp/RRDfilesinrange.txt&quot; 
STARTDATE=&#039;date --utc --date &quot;2010-02-27 06:00:00&quot; %s&#039; 
ENDDATE=&#039;date --utc --date &quot;2010-03-02 06:00:00&quot; %s&#039; 
cd C: temp/tsfr-complete
for f in $FILES 
do 
if [ -f $f ]; then 
FDATE=&#039;stat -c &quot;%Z&quot; $f&#039; 
if [ $FDATE -ge $STARTDATE ]; then 
if [ $FDATE -le $ENDDATE ]; then 
&#039;echo $f &gt;&gt; $OUTFILE&#039; 
fi 
fi 
fi 
done</description>
		<content:encoded><![CDATA[<p>if you wanted to pull a date from the directory  to only list files from datea/timea through dateb/timeb (say March 2 at 6:00 AM to March 8 at 6:00 AM) and move into a new file the output, how is this accomplished?  I tried this but no output<br />
#!/bin/bash<br />
FILES=&#8217;ls -A1&#8242;<br />
OUTFILE=&#8221;c:/temp/RRDfilesinrange.txt&#8221;<br />
STARTDATE=&#8217;date &#8211;utc &#8211;date &#8220;2010-02-27 06:00:00&#8243; %s&#8217;<br />
ENDDATE=&#8217;date &#8211;utc &#8211;date &#8220;2010-03-02 06:00:00&#8243; %s&#8217;<br />
cd C: temp/tsfr-complete<br />
for f in $FILES<br />
do<br />
if [ -f $f ]; then<br />
FDATE=&#8217;stat -c &#8220;%Z&#8221; $f&#8217;<br />
if [ $FDATE -ge $STARTDATE ]; then<br />
if [ $FDATE -le $ENDDATE ]; then<br />
&#8216;echo $f &gt;&gt; $OUTFILE&#8217;<br />
fi<br />
fi<br />
fi<br />
done</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sirdude</title>
		<link>http://www.cyberciti.biz/faq/linux-list-just-directories-or-directory-names/comment-page-1/#comment-46142</link>
		<dc:creator>Sirdude</dc:creator>
		<pubDate>Thu, 25 Feb 2010 18:27:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/faq/how-to-list-just-directories-or-directory-names/#comment-46142</guid>
		<description>nice stuff!

i learned a lot from the original post, but the comments are a treasure trove!

one thing about the original post, you have a back tick instead of a single quote in the 1st two snippets
ls -l &#124; egrep `^d&#039; for example should be ls -l &#124; egrep &#039;^d&#039; for the copy / pasters

thanks again ;)</description>
		<content:encoded><![CDATA[<p>nice stuff!</p>
<p>i learned a lot from the original post, but the comments are a treasure trove!</p>
<p>one thing about the original post, you have a back tick instead of a single quote in the 1st two snippets<br />
ls -l | egrep `^d&#8217; for example should be ls -l | egrep &#8216;^d&#8217; for the copy / pasters</p>
<p>thanks again ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mohammed asif</title>
		<link>http://www.cyberciti.biz/faq/linux-list-just-directories-or-directory-names/comment-page-1/#comment-45108</link>
		<dc:creator>Mohammed asif</dc:creator>
		<pubDate>Wed, 09 Dec 2009 11:29:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/faq/how-to-list-just-directories-or-directory-names/#comment-45108</guid>
		<description>i renamed a directory name with a space in between the directory name within GUI(Graphical User Interface)
which is allowed and now in the shell prompt i.e. in the terminal command mode i want to enter the directory which has a space in between but it does not allows to enter into that directory it says &quot;INVALID DIRECTORY&quot;
is their any alternative solution or trick to enter into the directory with the name having space.please explain
the directory name is &quot;file data&quot;
i tried with    ---     $cd file data    but it didnt work out.</description>
		<content:encoded><![CDATA[<p>i renamed a directory name with a space in between the directory name within GUI(Graphical User Interface)<br />
which is allowed and now in the shell prompt i.e. in the terminal command mode i want to enter the directory which has a space in between but it does not allows to enter into that directory it says &#8220;INVALID DIRECTORY&#8221;<br />
is their any alternative solution or trick to enter into the directory with the name having space.please explain<br />
the directory name is &#8220;file data&#8221;<br />
i tried with    &#8212;     $cd file data    but it didnt work out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amr</title>
		<link>http://www.cyberciti.biz/faq/linux-list-just-directories-or-directory-names/comment-page-1/#comment-44271</link>
		<dc:creator>Amr</dc:creator>
		<pubDate>Fri, 23 Oct 2009 07:58:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/faq/how-to-list-just-directories-or-directory-names/#comment-44271</guid>
		<description>I tried with both GNU ls and BSD one and the best option is as someone else posted above:

ls -ld */</description>
		<content:encoded><![CDATA[<p>I tried with both GNU ls and BSD one and the best option is as someone else posted above:</p>
<p>ls -ld */</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amit Nagwanshi</title>
		<link>http://www.cyberciti.biz/faq/linux-list-just-directories-or-directory-names/comment-page-1/#comment-44159</link>
		<dc:creator>Amit Nagwanshi</dc:creator>
		<pubDate>Tue, 20 Oct 2009 05:30:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/faq/how-to-list-just-directories-or-directory-names/#comment-44159</guid>
		<description>one can list directory i simple and easy way by :
1. ls -ltr &#124; grep -e d
2. ls -ld */
3. du

third one is the most easiest way. :-)</description>
		<content:encoded><![CDATA[<p>one can list directory i simple and easy way by :<br />
1. ls -ltr | grep -e d<br />
2. ls -ld */<br />
3. du</p>
<p>third one is the most easiest way. :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anon</title>
		<link>http://www.cyberciti.biz/faq/linux-list-just-directories-or-directory-names/comment-page-1/#comment-44023</link>
		<dc:creator>anon</dc:creator>
		<pubDate>Wed, 07 Oct 2009 18:36:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/faq/how-to-list-just-directories-or-directory-names/#comment-44023</guid>
		<description>$ /bin/ls -l &#124; grep &quot;^d&quot; &#124; cut -d&#039; &#039; -f8
it&#039;s a neat trick on linux systems.

i&#039;m using /bin/ls and not ls because it may be aliased</description>
		<content:encoded><![CDATA[<p>$ /bin/ls -l | grep &#8220;^d&#8221; | cut -d&#8217; &#8216; -f8<br />
it&#8217;s a neat trick on linux systems.</p>
<p>i&#8217;m using /bin/ls and not ls because it may be aliased</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aditya</title>
		<link>http://www.cyberciti.biz/faq/linux-list-just-directories-or-directory-names/comment-page-1/#comment-42766</link>
		<dc:creator>Aditya</dc:creator>
		<pubDate>Tue, 28 Jul 2009 14:38:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/faq/how-to-list-just-directories-or-directory-names/#comment-42766</guid>
		<description>&gt;  i used to the $ du command to retrieve all directory names.
Jagan, 
du is used to calculate Disk Usage. I want to know did you tweak this command to display directory listing in pwd.  Please explain.</description>
		<content:encoded><![CDATA[<p>&gt;  i used to the $ du command to retrieve all directory names.<br />
Jagan,<br />
du is used to calculate Disk Usage. I want to know did you tweak this command to display directory listing in pwd.  Please explain.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jagan</title>
		<link>http://www.cyberciti.biz/faq/linux-list-just-directories-or-directory-names/comment-page-1/#comment-42306</link>
		<dc:creator>jagan</dc:creator>
		<pubDate>Tue, 30 Jun 2009 12:29:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/faq/how-to-list-just-directories-or-directory-names/#comment-42306</guid>
		<description>i used to the $ du command to retrieve all directory names.
$ du</description>
		<content:encoded><![CDATA[<p>i used to the $ du command to retrieve all directory names.<br />
$ du</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kopla</title>
		<link>http://www.cyberciti.biz/faq/linux-list-just-directories-or-directory-names/comment-page-1/#comment-41528</link>
		<dc:creator>kopla</dc:creator>
		<pubDate>Fri, 08 May 2009 10:34:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/faq/how-to-list-just-directories-or-directory-names/#comment-41528</guid>
		<description>oops! didnt read the other comments. Already many nice solutions have been posted :P</description>
		<content:encoded><![CDATA[<p>oops! didnt read the other comments. Already many nice solutions have been posted :P</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kopla</title>
		<link>http://www.cyberciti.biz/faq/linux-list-just-directories-or-directory-names/comment-page-1/#comment-41527</link>
		<dc:creator>kopla</dc:creator>
		<pubDate>Fri, 08 May 2009 10:22:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/faq/how-to-list-just-directories-or-directory-names/#comment-41527</guid>
		<description>Thanx, nice post. I was just thinking of doing it with awk but couldnt get the wildcard working. Now I am one step ahead in my shell knowledge ^^
To Dennis Quek above :
 A rather dirty solution but does the job. 

ls -l &#124; egrep &#039;^d&#039; &#124; awk &#039;$1=&quot; &quot;&#039; &#124; awk &#039;$1=&quot; &quot;&#039; &#124; awk &#039;$1=&quot; &quot;&#039; &#124; awk &#039;$1=&quot; &quot;&#039; &#124; awk &#039;$1=&quot; &quot;&#039; &#124; awk &#039;$1=&quot; &quot;&#039;&#124; awk &#039;$1=&quot; &quot;&#039;&#124; awk &#039;$1=&quot; &quot;&#039;

(forgive me if seeing this code gives someone a heart attack, all i can say is that I&#039;m still learning :P )
I would love if someone can give my code a neater look :)</description>
		<content:encoded><![CDATA[<p>Thanx, nice post. I was just thinking of doing it with awk but couldnt get the wildcard working. Now I am one step ahead in my shell knowledge ^^<br />
To Dennis Quek above :<br />
 A rather dirty solution but does the job. </p>
<p>ls -l | egrep &#8216;^d&#8217; | awk &#8216;$1=&#8221; &#8220;&#8216; | awk &#8216;$1=&#8221; &#8220;&#8216; | awk &#8216;$1=&#8221; &#8220;&#8216; | awk &#8216;$1=&#8221; &#8220;&#8216; | awk &#8216;$1=&#8221; &#8220;&#8216; | awk &#8216;$1=&#8221; &#8220;&#8216;| awk &#8216;$1=&#8221; &#8220;&#8216;| awk &#8216;$1=&#8221; &#8220;&#8216;</p>
<p>(forgive me if seeing this code gives someone a heart attack, all i can say is that I&#8217;m still learning :P )<br />
I would love if someone can give my code a neater look :)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.101 seconds -->
