Article 57P6B [SOLVED] File Format Issue over ssh find

[SOLVED] File Format Issue over ssh find

by
qombi
from LinuxQuestions.org on (#57P6B)
Hello,

I am attempting to build a file list with find on a remote server and print a file with the output to the local server where the ssh command was issued from. I am wishing to build this file list without directory paths just the filenames in a list. The issue I am experiencing is the output in the file of the filename list is shown below. I read the manpages for find, printf and did some google searches but I didn't find anything that helped.

#srv2

Code:ssh srv1 find /dir1/ -printf '%f\n' > srv1.txt

cat srv1.txt
file1file2file3file4file5file6file7
file8file9file10file11file12I would like for it to be one filename per line like this.

Code:cat srv1.txt
file1
file2
file3
file4
file5
file6
file7
file8
file9
file10If I execute the command locally it is formatted properly, only seems to not work when running it remotely.latest?d=yIl2AUoC8zA latest?i=M4MWrG5nFks:c6EHxXxCW2U:F7zBnMy latest?i=M4MWrG5nFks:c6EHxXxCW2U:V_sGLiP latest?d=qj6IDK7rITs latest?i=M4MWrG5nFks:c6EHxXxCW2U:gIN9vFwM4MWrG5nFks
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments