Only move all the files in a directory to a subdirectory

Advertisement

Dominion
Guest

Only move all the files in a directory to a subdirectory

Hi,

I have a directory called /Root/ and I need to copy only the files that exist in /Root/ to /Root/SubDir

When i execute "mv *.* /SubDir/ it fails telling me I cannot copy the file SubDir to /Subdir/Subdir

Is it possible to only moves the files in the current directory, or will it always copy the directories whenever i provide the wildcard?

Reply with quote

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

Re: Only move all the files in a directory to a subdirectory

There no easy way to do this.
You could enable XML logging, list the contents of the directory, generate set of mv commands only for the files and run the command set.
See documentation:
https://winscp.net/eng/docs/guide_interpreting_xml_log
_________________
Martin Prikryl

Reply with quote

Advertisement

You can post new topics in this forum