Get files and exclude subdirectories then move

Advertisement

m.mk53
Joined:
Posts:
5
Location:
Egypt

Get files and exclude subdirectories then move

Dear team,
I need to get files from WinSCP exclude all subdirectory and then all files to subdirectory in WinSCP too
Example: /home/user/dir1/child
I want to get files from dir1 to local e:\ excluding child then move all files from dir1 to child

Regards.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,253
Location:
Prague, Czechia

Re: Get files and exclude subdirectories then move

To download the files use:
get -filemask=|*/ /home/user/dir1/*
How do I transfer (or synchronize) directory non-recursively?

Though the move part is more complicated, as the mv command does not support file masks, so you cannot exclude the subfolder.
Cannot you identify the files for example by an extension?
Cannot you move your child subfolder elsewhere (not under the dir1)?

Reply with quote

m.mk53
Joined:
Posts:
5
Location:
Egypt

Thanks martin for your reply
I can make child to be another path /home/userchid
Also extension could be xls and txt
Thanks for support

Reply with quote

Advertisement

You can post new topics in this forum