LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   List directory into one line (https://www.linuxquestions.org/questions/linux-newbie-8/list-directory-into-one-line-572194/)

ufmale 07-25-2007 11:50 AM

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").

wjevans_7d1@yahoo.co 07-25-2007 12:09 PM

I thought I understood, until I read your whole request.

Could you please give an example of how such output would look?

farslayer 07-25-2007 01:58 PM

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

colucix 07-26-2007 03:38 AM

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.

ufmale 07-27-2007 07:17 PM

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


All times are GMT -5. The time now is 06:27 PM.