How to join multiple lines of file names into one with custom delimiter?

JavaRocky picture JavaRocky · May 4, 2010 · Viewed 257.1k times · Source

I would like to join the result of ls -1 into one line and delimit it with whatever i want.

Are there any standard Linux commands I can use to achieve this?

Answer

Artem picture Artem · Jun 30, 2011

Similar to the very first option but omits the trailing delimiter

ls -1 | paste -sd "," -