LinuxQuestions.org
Visit Jeremy's Blog.
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, 12:50 PM   #1
ufmale
Member
 
Registered: Feb 2007
Posts: 385

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, 01:09 PM   #2
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 30
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, 02:58 PM   #3
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,232
Blog Entries: 5

Rep: Reputation: 190Reputation: 190
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, 04:38 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
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, 08:17 PM   #5
ufmale
Member
 
Registered: Feb 2007
Posts: 385

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


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


All times are GMT -5. The time now is 10:59 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration