How to move one file to a folder using terminal?

use the mv command. It might be more complicated as you may have problems with ownership / permissions if you have moving a file outside of $HOME.

Commented May 14, 2014 at 16:13 Possible duplicate of How to copy or move a file from a folder to desktop? Commented Jul 6, 2017 at 13:43

@muru: That question is distinctly different because it's asking how to move files to the desktop specifically.

Commented Jul 7, 2017 at 0:56

2 Answers 2

mv [file] [directory] 

For example, to move info.txt from the actual directory into the config/ directory, type mv info.txt config/

As was pointed out in a correct comment, the above will fail if the user running the command doesn't have write access to either the file or the folder.

If you prefix the command with sudo , you are telling the system to run the command as the root user (similar to an Admin account). Example:

sudo mv info.txt config/ 

BIG IMPORTANT NOTE:
Only use sudo if you are sure you know what you're doing - Ubuntu protects things for a reason. Using sudo you can break your OS, forcing a reinstall, if you move (or delete or whatever) important files.