Thursday, December 5, 2019

command line - How to send terminal output to text file without newline

I am using the find command to find files of a certain type recursevely in subdirectories. I am trying to send the output from the 'find' command to a text file. However the long file paths returned get split onto multiple lines. I would like to output each file path on a single line.



The command I am using is something like



find /path/to/directories -name *.cdf > filelist.txt



the output I get looks like:




/path/to/directories/directory1/subdir
ectory1/file1.cdf
/path/to/directories/directory1/subdir
ectory1/file2.cdf
/path/to/directories/directory2/subdir
ectory2/file3.cdf


I want my output file to look like:




/path/to/directories/directory1/subdirectory1/file1.cdf
/path/to/directories/directory1/subdirectory2/file2.cdf
/path/to/directories/directory2/subdirectory1/file3.cdf


Any help on how to accomplish this would be much appreciated.



Thanks

No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...