LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 07-25-2007, 11:50 AM   #1
ufmale
Member
 
Registered: Feb 2007
Posts: 386

Rep: Reputation: 30
List directory into one line


How do I create a list of directory into one line instead of multiple directory per line (as output of "ls -d").
 
Old 07-25-2007, 12:09 PM   #2
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 31
I thought I understood, until I read your whole request.

Could you please give an example of how such output would look?
 
Old 07-25-2007, 01:58 PM   #3
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
how about the option '-1' that's a hyphen and the number one, for one file per line..

Quote:
man ls
-1 list one file per line
ls -d1
 
Old 07-26-2007, 03:38 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
You may also consider
Code:
find . -type d
to exclusively and recursively look for directories, starting from the current one and displaying them one per line.
 
Old 07-27-2007, 07:17 PM   #5
ufmale
Member
 
Registered: Feb 2007
Posts: 386

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by colucix
You may also consider
Code:
find . -type d
to exclusively and recursively look for directories, starting from the current one and displaying them one per line.
Code:
I just got it working using
 $echo $(ls -d)
Thanks guys
 
  


Reply



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
directory list ygloo Linux - General 8 09-13-2006 05:59 AM
command line printer list paul_mat Linux - Software 1 05-09-2006 03:09 AM
Apache Directory Listing Of NFS Mount, cannot view directory list via apache luqmana Linux - Networking 2 12-19-2005 06:03 AM
2-line message list in Kmail? supes Linux - Software 1 01-12-2005 08:48 PM
How may I list only the directories in command line? geraldomanaus Linux - Newbie 5 03-20-2003 12:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:32 AM.

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