If you want to get a detailed listing of the files in directory opt/apache../webapps/Context on remote machine remotemachine, use:
ssh remotemachine "ls -l /opt/apache../webapps/Context"
If you want to search recursively for all files in that directory and all its subdirectories, then use:
ssh remotemachine "find /opt/apache../webapps/Context -type f -exec ls -l {} +"
How it works
ssh remotemachine commandThis executes
commandonremotemachineusing secure-shell (ssh).commandcan be any command of your choosing. In the two examples above, I used:ls -l /opt/apache../webapps/ContextThis displays the directory listing of
/opt/apache../webapps/Contextin the "long" format. You may use any ofls's options to select the format or sorting that you prefer. Seeman ls.find /opt/apache../webapps/Context -type f -exec ls -l {} +This uses
findto search recursively through subdirectories. The files it finds are again displayed withls.-type ftellsfindto show only regular files and not directories.findhas many options which you may use to select just the files that interest you. Seeman find.
More Options
If you want to save the output to a file, use redirection. For example:
ssh remotemachine "ls -l /opt/apache../webapps/Context" >outputfile
If you want both to display the output on the screen and also to save to a file, use tee:
ssh remotemachine "ls -l /opt/apache../webapps/Context" | tee outputfile