Skip to main content
edited body
Source Link
Kusalananda
  • 356.2k
  • 42
  • 737
  • 1.1k

The tr utility could be used to replace each space by a newline like so:

tr ' ' '\n' <infile >outfile

If there are multiple spaces between the filenames on the line, you may compress the generated newlines inteinto single ones using tr -s.

This obviously assumes that none of the filenames contain embedded space characters.

You may also achieve the same affect with sed:

sed 'y/ /\n/' infile >outfile

The tr utility could be used to replace each space by a newline like so:

tr ' ' '\n' <infile >outfile

If there are multiple spaces between the filenames on the line, you may compress the generated newlines inte single ones using tr -s.

This obviously assumes that none of the filenames contain embedded space characters.

You may also achieve the same affect with sed:

sed 'y/ /\n/' infile >outfile

The tr utility could be used to replace each space by a newline like so:

tr ' ' '\n' <infile >outfile

If there are multiple spaces between the filenames on the line, you may compress the generated newlines into single ones using tr -s.

This obviously assumes that none of the filenames contain embedded space characters.

You may also achieve the same affect with sed:

sed 'y/ /\n/' infile >outfile
Source Link
Kusalananda
  • 356.2k
  • 42
  • 737
  • 1.1k

The tr utility could be used to replace each space by a newline like so:

tr ' ' '\n' <infile >outfile

If there are multiple spaces between the filenames on the line, you may compress the generated newlines inte single ones using tr -s.

This obviously assumes that none of the filenames contain embedded space characters.

You may also achieve the same affect with sed:

sed 'y/ /\n/' infile >outfile