Solved

mv(linux) command under windows

Posted on 2003-11-14
12
643 Views
Last Modified: 2010-05-18
hi

can some tell me if i can move files and folder from one folders to another ?
( like linux )

mv /tmp/* /tmp2  /rf     -----> this command will move everyhing from /tmp to /tmp2


i am looking this command for windows/dos


victor


0
Comment
Question by:victorbx
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 2
  • +2
12 Comments
 
LVL 45

Expert Comment

by:sunnycoder
ID: 9746042
Hi victorbx,

there is a move command on windows
move /?

but I doubt it supports wildcards ... anyway you can download cygwin and get linux functionality on windows machine

Cheers!
Sunny:o)
0
 
LVL 4

Author Comment

by:victorbx
ID: 9746049
well i need the regular way ,

i need it for a corporate windows server to perform some task
on a file server


victor
0
 
LVL 4

Expert Comment

by:graemeboro
ID: 9746989
Is this an automated task or some-thing you are doing yourself?  You can use the standard MS-DOS commands in Windows 2k within a script or manually.
0
Free Webinar: AWS Backup & DR

Join our upcoming webinar with experts from AWS, CloudBerry Lab, and the Town of Edgartown IT to discuss best practices for simplifying online backup management and cutting costs.

 
LVL 45

Expert Comment

by:sunnycoder
ID: 9747091
move c:\windows\temp\*.* c:\temp - This would move the files of c:\windows\temp to the temp directory in root, this is of course assuming you have the windows\temp directory.

http://www.computerhope.com/movehlp.htm#04
0
 
LVL 4

Author Comment

by:victorbx
ID: 9749377
well ,
this is an automated task with the scheduler...

" move c:\windows\temp\*.* c:\temp " ----> will not move folders as well

i need to move every thing

                                                  EXTRA 500 FOR THE ONE WHO WILL FIND A SOLUTION


VICTOR
0
 
LVL 16

Expert Comment

by:_nn_
ID: 9751030
XXCopy can do that (see /RC option) : http://www.xxcopy.com
0
 
LVL 4

Author Comment

by:victorbx
ID: 9753221
i need the standard windows commands

builded batch files will be accepted as well

victor
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 9753260
xcopy source destination /E

This will copy everything "inside" source to destinations

rd /s source

will delete all file in source and its subdirectories


xcopy source destination /E
rd /s source

should do it for you
0
 
LVL 4

Author Comment

by:victorbx
ID: 9753286
i don't want to remove the directory ...
i want to delete everything in the directory including subfolder
and RD does not support wildcards


victor
0
 
LVL 45

Assisted Solution

by:sunnycoder
sunnycoder earned 250 total points
ID: 9753297
mv in linux does exactly that ... removes old one and creates new one
once you have copied everything to a new destination, removing old one will have same effect as mv
rd /s will remove all sub directories so it has same effect as *

if you want linux shell kind of regex, then you will have to use some external package because windows does not support them
0
 
LVL 16

Accepted Solution

by:
_nn_ earned 250 total points
ID: 9754800
Just trying to improve sunny's suggestion : in a batch file

xcopy source destination /E
del /f /s /q source\*
for /f "delims=" %%a in ('dir /b source\*') do rd /s /q "source\%%a"
0
 
LVL 1

Expert Comment

by:suredazzle
ID: 22845052
You can ......mv *.*  /dir

or

mv *.* ../dir

It works!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Arrow Electronics was searching for a KVM  (Keyboard/Video/Mouse) switch that could display on one single monitor the current status of all units being tested on the rack.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question