The commands which you would need to use are mv (short from move) and cp (short from copy).
The mv command syntax looks like this.
mv local.xml.sample local.xml
You can also use mv to move a whole directory and its contents:-
mv public_html/subfolder/* public_html/
This will move all files and folders from the location - public_html/subfolder/ to public_html
In some cases however, we will need to only update the files and move only files that were changed, which we can do by passing ‘-u’ as argument to the command:
mv -u test/* admin/test
The cp (copy) commands is similar to mv, but it copies the files/folders instead of moving it from one location to another.
cp local.xml.sample local.xml
The command will copy the local.xml.sample file to local.xml and will preserve the original file (the file will NOT be removed after it is copied).
cp also accepts various arguments:
cp -R admin/ admin_backup/
-R instructs cp to copy files recursively (for example, a whole directory). To overwrite already existing files you should use the -f argument:
The following commands in your console should show all available options and switches for both the commands. It pulls up the manual of the commandscp -fR admin/ includes/admin/
man mv
man cp