I have researched on google about copying a whole directory home to another user account on my Linux machine but i have not encountered one post about this. People usually want to copy a particular path but not the whole directory.
By reading three articles that i will post here later on(i have read a bunch more but these three were the best ones i founded) i have founded that the best command line i can write to do what i want is:
$ sudo cp -a /home/user1/ /home/user2/
$ sudo chown -R user2:user2 /home/user2/
These are the links i founded the best.
- https://linuxize.com/post/how-to-copy-files-and-directories-in-linux/
- https://linuxize.com/post/cp-command-in-linux/
- https://askubuntu.com/questions/86822/how-can-i-copy-the-contents-of-a-folder-to-another-folder-in-a-different-directo
The problem is i cannot copy every file i have there, for example:
"cp: cannot stat '/home/user1/.var/app/org.mozilla.firefox/cache/mozilla/firefox/4dcohxta.default-release/cache2/entries/C02B703BAA45ED748D7DB6B07D15FA0DFCCD37E8': No such file or directory"
Which other command could help me resolve this problem? Are the two command lines i posted safe to write and achieve what i want or can i choose better ones?