Skip to content

Moving and sharing files ​

A copy you have not checked is a copy you are guessing about. This lesson covers the two big copying jobs, moving to a new computer and sending files between devices, and the two ways to prove a copy is complete: comparing folders and comparing checksums.

Moving to a new computer: what to bring ​

Files are the obvious part. The things people forget are the ones that are hard or impossible to recreate.

BringWhere it usually lives (Linux)Why it matters
Personal files~/Documents, ~/Pictures, ~/Videos, ~/Music, ~/Desktop, ~/DownloadsThe obvious part
App settings~/.config, ~/.local/share, dotfiles such as .bashrc and .gitconfigHours of small choices
SSH keys~/.sshYour access to servers and Git hosts. A lost private key cannot be recreated
Other keysFor example GPG keys in ~/.gnupgSigning and decrypting. Lost keys mean files you can no longer open
PasswordsYour password manager, and saved logins in browser profilesCheck your password manager's own export or sync before you wipe anything
Browser profilesFirefox, Chrome and others keep them under your home folderBookmarks, saved logins, open sessions
List of appsYour package manager knows itFaster than remembering what you installed
Licences and recovery codesWherever you saved themTwo-factor recovery codes are often the only way back into an account

And some things never live in your home folder at all, such as saved Wi-Fi passwords and system settings. Note them down before you start.

Moving with Clone Studio ​

Clone Studio moves your home folder and app list from an old Linux computer to a new one. You run it on both: the old computer chooses what to send, and the new one reviews it and can untick items before anything is written.

text
  OLD computer                                     NEW computer
  "This is my OLD computer"                        "This is my NEW computer"
  choose a mode ─┐                              ┌─ type the 6-digit code
                 │  Wi-Fi / network cable / USB │  Review what's coming
                 └─────────────────────────────▶└─ Bring it over
                                                   receipt: Verified

Its modes decide what moves:

ModeWhat it moves
Safe TransferApps and your personal files. Nothing else
RecommendedApps, files and your settings, including ~/.config, dotfiles, SSH keys, browser profiles, desktop look and feel and your crontab
CustomExactly what you tick, file by file

Some details that matter for safety:

  • It copies. Nothing is deleted from the old computer.
  • It never overwrites. A file that already exists on the new computer is kept, and the incoming one is saved beside it with (from old computer) in its name.
  • Network transfers are encrypted, and the 6-digit code ties the connection to the two computers in front of you.
  • A USB copy is not encrypted. Anyone holding the drive can read it, SSH keys and browser profiles included. Erase the CloneStudio folder from the drive afterwards.
  • Apps move as a list, which the new computer offers to reinstall. Saved Wi-Fi passwords, the operating system and caches do not move. Keys outside its lists, such as ~/.gnupg, are not part of either preset: check them yourself.

The receipt at the end says Everything double-checked: Verified when every file was checked again after the transfer, and lists Files that need another pass. Even so, open a few documents, start your browser and try an SSH connection before you erase the old computer. See What is and is not moved and Finish on the new computer.

Sending files between devices ​

For a few files, pick the simplest route that keeps them private.

RouteGood forWatch out for
USB stick or external diskLarge amounts, no networkFAT32 sticks cannot hold files of 4 GiB or more. A lost stick can be read by whoever finds it
Network cable between two computersA whole computer's worth of data, fastNeeds a tool on both sides, such as Clone Studio over a cable
Nearby sharing over Wi-FiPhotos from a phone, a document to a laptopBoth devices on the same network; check who you are sending to
Cloud or chat appSomeone far awayThe file passes through someone else's servers

NearShare brings Quick Share, the nearby-sharing system built into Android and available for Windows, to the Linux desktop. Both devices need to be on the same Wi-Fi network. Transfers go straight from one device to the other over your local network, encrypted end to end, with no account and no server.

The safety step is the PIN: both screens show four digits. If they match, no one is in the middle. NearShare cannot remember trusted devices, so it asks every time, even for your own phone. Only accept transfers you expect. Received files go to your Downloads folder, and a file with the same name is never overwritten: NearShare adds a number, such as photo (1).jpg. See Receive files and Send files.

Compare two folders before you trust a copy ​

After any big copy, ask: is everything there, and is it the same? Looking at the file count is not enough. Compare the two folders.

Delta View (the app calls itself DeltaView) shows two folders as one tree with four counters:

CounterMeaning after a copy
identicalCopied correctly
modifiedOn both sides, but different: a damaged or partial copy, or a file changed since
left onlyMissed: on the original (left) but not the copy (right)
right onlyOnly in the copy, for example a file added there later

A good copy shows only identical files, and the view says "Folders are identical". Put the original on the Left and the copy on the Right so the counters read naturally.

Quick compare is not proof

With Quick compare on, DeltaView treats files with the same size and modification time as identical without reading them. That is fast, but a damaged copy can have the right size and date. To prove a copy, leave Quick compare off so DeltaView reads and compares the contents.

On the command line, diff -rq does a similar check and prints only the differences:

bash
diff -rq Photos Photos-copy
text
Files Photos/hill.jpg and Photos-copy/hill.jpg differ

Comparing folders needs both copies side by side. When they are not, for example a file you downloaded, or a backup on a disk in a drawer, use a checksum.

Checksums: a fingerprint for a file ​

A checksum (or hash) is a short string computed from every byte of a file. Change one byte and the checksum changes completely. If two files have the same SHA-256 checksum, you can treat them as identical.

Make a list of checksums for a folder:

bash
cd Photos
sha256sum * > ../photos.sha256
cat ../photos.sha256
text
0ae145307f9dbf8c2998fae160280ed3ac6be4cef6f8bbb7d0ce0badcf10b2ff  beach.jpg
e4a0bb62dd9a0993890c564e8bd4ee06f6b88bf30616f96dc8d60778789c88e9  cake.jpg
b05a813cab5cd772a9d7c85305f035d6013728f4077c14d403c94e58ba4982bf  hill.jpg

Later, or on another computer, check a copy against the list with -c:

bash
cd ../Photos-copy
sha256sum -c ../photos.sha256
text
beach.jpg: OK
cake.jpg: OK
hill.jpg: FAILED
sha256sum: WARNING: 1 computed checksum did NOT match

hill.jpg in the copy differs from the original: copy it again. The command also exits with a non-zero status, so scripts can tell.

On Windows, PowerShell has the same tool built in: Get-FileHash .\beach.jpg prints the SHA-256 of a file.

Checksums are also how you check a download. Projects that publish disc images, such as Linux installers, list the SHA-256 of each file next to the download. Compare it with the checksum of the file you got before you burn or install it.

Apps use checksums too. CloudDrop's Free Up Space compares the cloud's checksum with the local file before it removes anything, and Disc Writer checks a burned data disc against checksums recorded during the burn.

Stay safe ​

  • Keep the old copy until the new one is checked. Do not wipe the old computer, the camera card or the old disk until a comparison or checksum says the copy is complete.
  • Treat keys and browser profiles as secrets. Move them only to computers you own, and do not leave them on a USB stick.
  • Check the PIN on both screens before you accept a nearby transfer, and decline anything you did not expect.
  • Check before you sync. A folder comparison is read-only; a Synchronize… run in DeltaView overwrites and deletes, and cannot be undone.
  • Verify downloads against the checksum the project publishes, from the project's own site.

Check yourself ​

QuizMoving and sharing files

Question 1 of 6

You are moving to a new Linux computer. Which of these is hardest to recreate if you forget it?

Score: 0

What you learned ​

  • Moving computers means files, settings, keys, passwords and an app list, not just documents.
  • Clone Studio copies without deleting or overwriting, encrypts network transfers but not USB copies, and ends with a verified receipt.
  • NearShare sends files over local Wi-Fi, encrypted, after you compare a PIN.
  • A folder comparison with Quick compare off, or a checksum list, proves a copy is complete.

Next steps ​