paste -s -d
joins lines with a delimiter (e.g. ","
), and does not leave a trailing delimiter:
ls -1 | paste -sd "," -
More Related Contents:
- How to join multiple lines of file names into one with custom delimiter?
- How do I prompt for Yes/No/Cancel input in a Linux shell script?
- Iterate over a list of files with spaces
- ./configure : /bin/sh^M : bad interpreter [duplicate]
- Defining a variable with or without export
- The ‘eval’ command in Bash and its typical uses
- Better way to rename files based on multiple patterns
- How do I know the script file name in a Bash script?
- Syntax error in shell script with process substitution
- Linux: copy and create destination dir if it does not exist
- What is the difference between “#!/usr/bin/env bash” and “#!/usr/bin/bash”?
- How to handle more than 10 parameters in shell
- How to preserve line breaks when storing command output to a variable?
- Is it OK to use the same input file as output of a piped command?
- Changing default shell in Linux [closed]
- How to use sed to remove the last n lines of a file
- Example of using named pipes in Linux shell (Bash)
- Passing variables in remote ssh command
- How do I run multiple background commands in bash in a single line?
- How to get file creation date/time in Bash/Debian?
- Execute command after every command in bash
- How do I change bash history completion to complete what’s already on the line?
- What is the Linux equivalent to DOS pause?
- Running shell script in parallel
- How to check if sed has changed a file
- What’s the point of eval/bash -c as opposed to just evaluating a variable?
- How to convert hex to ASCII characters in the Linux shell?
- Linux shell script to add leading zeros to file names
- How to avoid race condition when using a lock-file to avoid two instances of a script running simultaneously?
- Need to remove the count from the output when using “uniq -c” command