Recently a friend of mine, brought a new Laptop. He installed Red Hat Enterrpise Linux workstation 4.0. However, after installation he realized that he lost all his Mozilla thunderbird emails and Firefox bookmarks, chat client logs and other files.
I told him just copy all old files from /home/$you to a new system /home/$you directory. He was trying some age-old tutorial from net, which explains how to copy files using tar and restore it back to new system. During this procedure, he was messing up with file system permissions.
Finally, with frustration he brought both laptops to my place. I demonstrate both of following methods that can copy files in jiffy.
Copy all files and directories using scp
The easiest way to copy all files (including hidden dot files) is as follows using the scp command:
$ scp -r /home/you/. you@new-system:/home/you
OR
$ scp -r /home/you/. you@192.168.1.100:/home/you
Note: Appending a dot (.) symbol (current directory) is very important when you specify /home/you/ as a source path. If you skip dot in path it will only copy only normal files and scp will skip all hidden files.
Copy all files and directories using graphical method
- Login to old system
- Open two instants of Konqueror browser (i.e. open it two times)
- Go to first window and type in Location bar /home/yourname
- By default Konqueror will not display hidden files/directories. To see hidden files or folders use the Menubar View > Show Hidden Files option.
- Now select all files copy them (CTRL + C or Menubar Edit > Copy option)
- Now go to second Konqueror window and type in Location bar and type command: fish://you@newsystem
- You are using Konqueror with ssh to manage files on a Remote system called newsystem. You can use IP address instead of hostname.
- It will prompt for ssh password. Once logged in you can paste the files, folders, and hidden files.
- Now just past all files and folder
Recommended Tool
I recommend using the rsync command – a fast and extraordinarily versatile file copying tool as follows. Login to your old laptop and type:
$ cd /home/you
$ rsync -avz * user@newsystem:/home/user/
OR
$ rsync -avz * user@192.168.1.10:/home/user/
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
- RSS feed or Weekly email newsletter
- Share on Twitter • Facebook • 2 comments... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
Thanks for the heads up
Actually isn’t correct this: fish:you@newsystem
Type fish://you@newsystem instead :-}