• Post Reply Bookmark Topic Watch Topic
  • New Topic

getting and deleting files from the remote system ...?

 
satya kiran
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am having two different machines within the same intranet.
i am copying the files from my machine to the destination machine by using 'scp' in the java code.
Now, i have to get all the files in a directory present in the destination machine to my local machine using the same 'scp' and after getting the files i want to remove the files from destination directory.
how can i do this? How can i get list of files from destination directory (i know if it is in local machine i can say file.list()). how can i delete the files from destination folder? (assume that i have drwx previleges).
Thanks in advance for your help.
satya kiran
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, if you're already using "scp" to copy the files, why not use "ssh ls" to get a file listing, and "ssh rm" to remove files?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!