How to easily transfer files between computers with croc

In case you’re on the lookout for a simple command-line instrument to switch information between methods on the identical LAN, Jack Wallen believes croc is the instrument for the job.


Illustration: Lisa Hornung/TechRepublic

Often, after I need to switch information between computer systems on the identical community, I will use the scp command. However generally I would like one thing a bit less complicated to make use of. When these cases come up, I flip to a really useful command-line instrument referred to as croc. With this easy-to-use instrument, you possibly can switch information and folders from one system to a different, with out having to recollect a lot in the best way of instructions. 

SEE: Hiring Equipment: Linux Administrator (TechRepublic Premium)

Croc is a cross-platform file-sharing instrument that creates a full-duplex communication layer between machines, so it does not require the addition of port forwarding. Croc may be put in on Linux, macOS and Home windows, so you possibly can switch information between any system in your community.

I’ll present you simply how simple croc is to put in and use.

What you may want

I will be demonstrating on two Linux machines, each of that are Ubuntu-based. In case you’re interested by putting in croc on both macOS or Home windows, you may must have both Scoop (Home windows) or Homebrew (macOS) put in. You will additionally want a person with admin (sudo) rights.

That is it. Let’s get to work.

set up croc

To put in croc on a Ubuntu-based distribution, obtain the .deb file with the command:


NOTE: Be certain to take a look at the croc obtain web page to make sure you’re downloading the most recent launch.

You will must obtain that .deb file to all Ubuntu machines that can use croc. As soon as downloaded, set up croc with:

sudo dpkg -i croc*.deb

use croc

For example you’ve gotten a file named trtest you need to switch from Machine A to Machine B. Log into Machine A, open a terminal window, develop into the listing housing trtest, and challenge the command:

croc trtest

After verifying the switch (by hitting Y), the command will output a code for use on the receiving machine, equivalent to croc 7776-gorilla-london-turtle. Copy that whole code. 

Now, log into Machine B, open a terminal window, and paste the code you obtained from Machine A into the terminal. Hit Enter in your keyboard. You may be prompted to confirm the switch. Hit Y and the file will likely be obtained on Machine B.

In case you do not need to rely upon croc to generate random codes, you possibly can inform it to make use of a selected code like so:

croc --code YOUR_CODE FILE

The place YOUR_CODE is a novel code and FILE is the file to switch. 

To ship a file with a selected code, on Machine A, challenge the command:

croc ship --code techrepublic_is_awesome trtest

To obtain the file utilizing the particular code, on Machine B challenge the command:

croc techrepublic_is_awesome

And that is all there’s to utilizing croc. Even higher, the identical command works for information or folders, so you do not have so as to add any particular choices when sending folders.

Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the most recent tech recommendation for enterprise professionals from Jack Wallen.

Additionally see

Recent Articles


Related Stories

Leave A Reply

Please enter your comment!
Please enter your name here

Stay on op - Ge the daily news in your inbox