How to move the files based on the size with ascending order from one server to another in Linux.

  • 1
    How about this: tar -cvf - $(ls -l|sort -n -k +5|awk '{print $9}')|nc remote.host remote.port? – peterh - Reinstate Monica Jan 13 at 7:41
  • thanks but we are trying with scp so if there is anyother alternative solution there? – vk_dinesh Jan 13 at 8:39
  • 1
    scp -v $(ls -l|sort -n -k +5|awk '{print $9}') you@remote.server It can not handle files with spaces in it. – peterh - Reinstate Monica Jan 13 at 10:27
  • where I can specify my files path here – vk_dinesh Jan 13 at 13:06
  • It works from the current directory. It copies only files (no directories, etc). – peterh - Reinstate Monica Jan 13 at 13:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.