Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-12-2003, 05:40 PM   #1
gary knott
LQ Newbie
Registered: Oct 2003
Location: washington DC suburbs
Distribution: redhat 6,8
Posts: 4

Rep: Reputation: 0
Asking LS for a list of directories only

How do I ask LS to list only the directories in my current directory or in a specified directory?

Also how do I ask LS to list only the files (not the directories)?

Also how do I ask LS to list only the files beginning with a period (.) ? Using backslash as in
ls \.* does not work. Evidently the backslash does not quote the period as bash documentation says it will.


Gary Knott,
Old 11-12-2003, 05:49 PM   #2
LQ Newbie
Registered: Nov 2003
Posts: 16

Rep: Reputation: 0
for a list of directories only try

ls -d

im unsure how to only get a list of files but you should check out

man ls


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] command to list directories only frieza Linux - Software 16 04-01-2016 11:53 AM
Can ls recursively list only directories? Vosper Linux - General 3 07-16-2005 03:57 AM
proftpd directories list bacon22 Linux - Networking 2 01-21-2004 09:49 AM
list sub-directories only CowboyJ Linux - Newbie 1 12-04-2003 11:42 PM
list of directories greg108 Linux - Newbie 5 08-08-2003 03:11 AM

All times are GMT -5. The time now is 10:37 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration