As I am new to unix, can somebody tell me how to move a file please. I got an error message as missing destination file operand.
mv dog/mammals/shape
As I am new to unix, can somebody tell me how to move a file please. I got an error message as missing destination file operand.
mv dog/mammals/shape
mv
takes two arguments: SOURCE
and DEST
where SOURCE
is the file you want to move in its original location, and DEST
is where you want to move it.
Arguments are space-delimited. You provided a command which only gives one argument:
mv dog/mammals/shape
This says move the file/dir called shape
from dog/mammals/
to somewhere that isn't defined.
The correct answer is:
mv animals/mammals/dog shape/
You can think of this as: "move file animals/mammals/dog to shape/"
animals/mammals/dog
or shape/
doesn't exist. Create the former with mkdir -p animals/mammals && touch animals/mammals/dog
or create the latter with mkdir shape
.
– Stewart
Sep 02 '20 at 18:54
$ mv mydir/animals/mammals/dog mydir/shape/
– gracesam Sep 03 '20 at 05:33