bojo Posted October 1, 2005 Report Share Posted October 1, 2005 (edited) Hi Guys, for some reason when I redirect ls to a file it always have new lines inserted. even if I try to use ls -m it still inserts new line after about 3 entries. I expect to have one line with all the files listed separated by space... it used to be like this every advice will be appreciated thanks a lot bojo Edited October 2, 2005 by bojo Quote Link to comment Share on other sites More sharing options...
ramfree17 Posted October 2, 2005 Report Share Posted October 2, 2005 afaik it has always been like that, each file is on a separate line as if it ls was given with a -l format (minus the details). ciao! Quote Link to comment Share on other sites More sharing options...
PeterPanic Posted October 2, 2005 Report Share Posted October 2, 2005 (edited) Just try ls -mw100000 > list.txt (or "man ls" :D ) The -w -Option will let you set the width of the lines. Just set it to infinity and you'll get what you want. echo * > list.txt should do almost the same. There, of course, are even more complex things you can do with gawk and sed... To format the list differently... Cya. PeterPanic Edited October 2, 2005 by PeterPanic Quote Link to comment Share on other sites More sharing options...
bojo Posted October 2, 2005 Author Report Share Posted October 2, 2005 Thanks a lot Peter - it works for me this way bojo Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.