Replacing a file inside a hidden folder via terminal
Solution 1:
1. The console way:
If you want to move/copy from .directory to the Desktop:
mv /path/to/.directory/filename ~/Desktop cp /path/to/.directory/filename ~/Desktop
Alternatively, if you want to move/copy from the Desktop into .directory:
mv ~/Desktop/filename /path/to/.directory cp ~/Desktop/filename /path/to/.directory
The difference between mv and cp is:
mv will move a file (the file at origin gets destroyed).
cp will copy a file (you get to keep the file at origin).
2. The GUI way:
Open your file manager and activate Show hidden files (Ctrl+H on PcManFM and many others). You can then navigate any hidden directories and drag and drop your file to its intended destination.