Is there a way to make mv create the directory to be moved to if it doesn’t exist?
How about this one-liner (in bash): mkdir –parents ./some/path/; mv yourfile.txt $_ Breaking that down: mkdir –parents ./some/path # if it doesn’t work; try mkdir -p ./some/path creates the directory (including all intermediate directories), after which: mv yourfile.txt $_ moves the file to that directory ($_ expands to the last argument passed to the previous … Read more