title: copy file from linux server directory to other directory using jsch
body: <p>I want to copy the file <code>/home/user/dir1/abc.txt</code> to <code>/home/user/dir2/</code>. I am new to linux and jsch so, guide me to copy above file in dir. I tried with following code but it not working for me.</p>
  
  <pre><code>public static void main(String args[]){
  
      String host = "192.168.11.90";
      String user = "Smt";
      String password = "ping";
      String command = "./test/stable-uniconnect-server-0.179/bin/launcher run";
      String src ="/home/Smt/abc/text1.txt";
      String dest ="/home/Smt/abcd";
      String cp = "mv -u /home/Smt/abc/text1.txt /home/Sumit/abcd/";
      try{
      Properties config = new Properties();
      config.put("StrictHostKeyChecking", "no");
      JSch jsch = new JSch();
      // Create a JSch session to connect to the server
      Session session = jsch.getSession(user, host, 22);
      session.setPassword(password);
      session.setConfig(config);
      // Establish the connection
      session.connect();
      ChannelExec channel = (ChannelExec) session.openChannel("exec");
      channel.setCommand(cp);
      channel.setErrStream(System.err);
      System.out.println("Connected...");
      String dir="abc";
  
       session.disconnect();
      }
      catch(Exception e){
          e.printStackTrace();
      }
  }
  </code></pre>