I have a find command that gives the list of files that are older than 5 days, i can tee it into a text file.

find . -type f -mtime +5 -ls | tee $dir/new.txt

Now i want to send this text file to a remote server into a dir. How do i do that.


I got what i wanted using this:

find  . -type f -mtime +5 -ls | ssh remoteuser@remoteserver "cat >> $dir/new1.txt"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.