i'm on a mac with OSX 10.5

i'm using tcsh but i could use bash if it'd help

link|improve this question

36% accept rate
feedback

2 Answers

up vote 0 down vote accepted

Try

ls -1 /directory/you/want/to/list > ~/Desktop/filelist.txt

which will redirect the output of ls -1 (or ls -l or whatever you want) to the file ~/Desktop/filelist.txt. Using > for redirecting outpiut works for every command, btw. Just google about "input output redirection" (or see this link).

link|improve this answer
1  
When its output is redirected, ls automatically uses single-column output mode, so the -1 above is not necessary. – garyjohn Oct 1 '10 at 15:48
feedback

ls "path/to/folder/" > file.txt

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.