Topic "Only move all the files in a directory to a subdirectory"

Author Message



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?
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24736
Location: Prague, Czechia
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:
Martin Prikryl

You can post new topics in this forum

Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License