Article 4YCM5 Query on find command

Query on find command

by
nextStep
from LinuxQuestions.org on (#4YCM5)
Hi

I am trying to get the file size,date time and filename from a remote server using shell script and automate the result every weekend.If i split the command individually the command works,however if given in shell script not getting the result,getting blank result.

Code:ssh user@$server "find /path1/path2/ -type f -name '*.json' -exec ls -lh {} \; | awk '{print $9 "\t" $8 " " $7 $6 "\t" $5}' | sed -r 's/^.+\///'"Expected result is as below

loc.json 15:04 21Jan 731M
prop.json 15:06 21Jan 4.7G

The file info
-rw-r--r-- 1 tomcat tomcat 731M Jan 21 15:04 loc.json
-rw-r--r-- 1 tomcat tomcat 4.7G Jan 21 15:06 prop.json

Any help is appreciatedlatest?d=yIl2AUoC8zA latest?i=pylos0uMCB0:d8hJSHAHuJ8:F7zBnMy latest?i=pylos0uMCB0:d8hJSHAHuJ8:V_sGLiP latest?d=qj6IDK7rITs latest?i=pylos0uMCB0:d8hJSHAHuJ8:gIN9vFwpylos0uMCB0
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