I have Machine-A and Machine-B and both are Ubuntu servers. Now I want to list all the files on Machine-B using ssh. I want to return the result in a text file so I can analyse the result and the use scp to copy the required files.
ssh my_user_name@192.168.150.4 'bash -s tree /f'
ssh my_user_name@192.168.150.4 'bash -s ls -LR'
Now this command is not giving the result I wanted. Can anyone help with this so I can list all files on the remote computer using ssh and return the output in the form of a text file.
I am using ls -LR to list files and SSH to remote script execution. From the Answer i worked on my problem and iam updating the question to match one little requirement.
I got the list of files throught this command ssh my_user_name@192.168.150.4 ls /something/sub > output.txt
But i want the md5sum of all files instead of names because 2 file names might get match.So is there any way to list all files and return all md5sum of all files and return to output.txt file.