Moving a file or directory to another directory

From CodeCodex



    // This will not move files across drives.
    // File (or directory) to be moved
    File file = new File("filename");
    // Destination directory
    File dir = new File("directoryname");
    // Move file to new directory
    boolean success = file.renameTo(new File(dir, file.getName()));
    if (!success) {
        // File was not successfully moved


Moves file(s) src to dest. If file and dest exist on the different disk partition, the file is copied instead.

require 'fileutils' src, dest


Using zmv function

autoload zmv
zmv -v file destiny

Using mv system command

mv -v file destiny