Cannot Move a txt file into a directory? Help! (Terminal)


#1

As you can tell - I’m completely new. I am trying to move a test.txt file into the directory testdir - but I cannot seem to do it as when I look up the file its not there. Here is what I have been typing. Please advise where I am going wrong.

**Abduls-MacBook-Pro:~ Monahim$ pwd
/Users/Monahim
Abduls-MacBook-Pro:~ Monahim$ man mv
Abduls-MacBook-Pro:~ Monahim$ man mv
Abduls-MacBook-Pro:~ Monahim$
Abduls-MacBook-Pro:~ Monahim$ mv -v test.txttestdir
usage: mv [-f | -i | -n] [-v] source target
mv [-f | -i | -n] [-v] source … directory
Abduls-MacBook-Pro:~ Monahim$ pwd
/Users/Monahim
Abduls-MacBook-Pro:~ Monahim$ mv test.txt ~/Users/Monahim/testdir
mv: rename test.txt to /Users/Monahim/Users/Monahim/testdir: No such file or directory
Abduls-MacBook-Pro:~ Monahim$ cd testdir
Abduls-MacBook-Pro:testdir Monahim$ pwd
/Users/Monahim/testdir
Abduls-MacBook-Pro:testdir Monahim$ mv testdir/test.txt
usage: mv [-f | -i | -n] [-v] source target
mv [-f | -i | -n] [-v] source … directory
Abduls-MacBook-Pro:testdir Monahim$ **

Many Thanks,


#2

The correct syntax for moving files in the command line is the following:

mv <source file(s)> <destination>

so, for example, if you have a file in your home directory named moveme.txt and you wanted to move it into the (already created) folder in ~/new_folder the syntax would be:

mv ~/moveme.txt ~/new_folder/


#3

Yep. I’ve got it. Thanks!