Programmer's Wiki
Advertisement
16px-Pencil

Bash[]

mv original_directory/filename new_directory/filename

Java[]

import java.io.File;

File source = new File("original_directory/filename");
File destination = new File("new_directory/");

boolean success = source.renameTo(new File(destination, source.getName())); 

if(success == false){
	System.out.println("move operation failed!");
}

DOS[]

MOVE yahoo.txt E:\

Windows Powershell[]

Move-Item yahoo.txt E:\
move -path yahoo.txt -destination E:\

See Also[]

Advertisement