如何使用自定义分隔符将多行文件名合并为一行? [英] How to join multiple lines of file names into one with custom delimiter?

查看:16
本文介绍了如何使用自定义分隔符将多行文件名合并为一行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将 ls -1 的结果合并成一行并用我想要的任何分隔符分隔它.

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

是否有任何标准的 Linux 命令可用于实现此目的?

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

推荐答案

类似于第一个选项,但省略了尾随定界符

Similar to the very first option but omits the trailing delimiter

ls -1 | paste -sd "," -

这篇关于如何使用自定义分隔符将多行文件名合并为一行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆