Need help to execute command

HI,

I have a directory called input directory called "input", The "input" directory contains file names (file1,file2,file3,file4), I want to write a command so that it will display all the file names with comma separated.

Desired output: file1,file2,file3 so on....

Regards
Akshay Agnihotri

 ls |tr '\n' ','

?

1 Like

if running linux :

ls -m input

---------- Post updated at 12:22 PM ---------- Previous update was at 12:13 PM ----------

or

ls -m input | tr -d ' '
1 Like