You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+38-28
Original file line number
Diff line number
Diff line change
@@ -49,76 +49,77 @@ sudo port install croc
49
49
50
50
On Windows you can install the latest release with [Scoop](https://scoop.sh/), [Chocolatey](https://chocolatey.org), or [Winget](https://learn.microsoft.com/en-us/windows/package-manager/):
51
51
52
-
```
52
+
```bash
53
53
scoop install croc
54
54
```
55
55
56
-
```
56
+
```bash
57
57
choco install croc
58
58
```
59
59
60
-
```
60
+
```bash
61
61
winget install schollz.croc
62
62
```
63
63
64
64
On Unix you can install the latest release with [Nix](https://nixos.org/nix):
65
65
66
-
```
66
+
```bash
67
67
nix-env -i croc
68
68
```
69
69
70
70
71
71
On Alpine Linux you have to install dependencies first:
72
72
73
-
```
73
+
```bash
74
74
apk add bash coreutils
75
75
wget -qO- https://getcroc.schollz.com | bash
76
76
```
77
77
78
78
On Arch Linux you can install the latest release with `pacman`:
79
79
80
-
```
80
+
```bash
81
81
pacman -S croc
82
82
```
83
83
84
84
On Fedora you can install with `dnf`:
85
85
86
-
```
86
+
```bash
87
87
dnf install croc
88
88
```
89
89
90
90
On Gentoo you can install with `portage`:
91
-
```
91
+
92
+
```bash
92
93
emerge net-misc/croc
93
94
```
94
95
95
96
On Termux you can install with `pkg`:
96
97
97
-
```
98
+
```bash
98
99
pkg install croc
99
100
```
100
101
101
102
On FreeBSD you can install with `pkg`:
102
103
103
-
```
104
+
```bash
104
105
pkg install croc
105
106
```
106
107
107
108
On Linux, macOS, and Windows you can install from [conda-forge](https://github.com/conda-forge/croc-feedstock/) globally with [`pixi`](https://pixi.sh/):
108
109
109
-
```
110
+
```bash
110
111
pixi global install croc
111
112
```
112
113
113
114
or into a particular environment with [`conda`](https://docs.conda.io/projects/conda/):
114
115
115
-
```
116
+
```bash
116
117
conda install --channel conda-forge croc
117
118
```
118
119
119
120
Or, you can [install Go](https://golang.org/dl/) and build from source (requires Go 1.17+):
120
121
121
-
```
122
+
```bash
122
123
go install github.com/schollz/croc/v10@latest
123
124
```
124
125
@@ -129,7 +130,7 @@ On Android there is a 3rd party F-Droid app [available to download](https://f-dr
129
130
130
131
To send a file, simply do:
131
132
132
-
```
133
+
```bash
133
134
$ croc send [file(s)-or-folder]
134
135
Sending 'file-or-folder' (X MB)
135
136
Code is: code-phrase
@@ -149,15 +150,15 @@ There are a number of configurable options (see `--help`). A set of options (lik
149
150
150
151
On Linux and Mac OS, the sending & receiving is slightly different to avoid [leaking the secret via the process name](https://nvd.nist.gov/vuln/detail/CVE-2023-43621). On these systems you will need to run `croc` with the secret as an environment variable. For example, to receive with the secret `***`:
151
152
152
-
```
153
+
```bash
153
154
CROC_SECRET=*** croc
154
155
```
155
156
156
157
This will show only `croc` in the process list of a multi-user system and not leak the secret.
157
158
158
159
For a single-user system the default behavior can be permanently enabled by running
159
160
160
-
```
161
+
```bash
161
162
croc --classic
162
163
```
163
164
@@ -168,30 +169,39 @@ Run this command again to disable classic mode.
168
169
169
170
You can send with your own code phrase (must be more than 6 characters).
By default, croc will prompt whether to overwrite a file. You can automatically overwrite files by using the `--overwrite` flag (recipient only). For example, receive a file to automatically overwrite:
178
179
179
-
```
180
+
```bash
180
181
croc --yes --overwrite <code>
181
182
```
182
183
184
+
### Excluding folders
185
+
186
+
You can exclude folders from being sent by using the `--exclude` flag with a string of comma-delimited exclusions. For example, if you want to send a folder but exclude any `node_modules` folders or `.venv` folders:
187
+
188
+
```bash
189
+
croc send --exclude "node_modules,.venv" [folder]
190
+
```
191
+
192
+
Exclusions work by excluding any absolute path that contains the string. So in the above example, any folder named `node_modules` or `.venv` will be excluded from the transfer.
183
193
184
194
### Use pipes - stdin and stdout
185
195
186
196
You can pipe to `croc`:
187
197
188
-
```
198
+
```bash
189
199
cat [filename] | croc send
190
200
```
191
201
192
202
In this case `croc` will automatically use the stdin data and send and assign a filename like "croc-stdin-123456789". To receive to `stdout` at you can always just use the `--yes` will automatically approve the transfer and pipe it out to `stdout`.
193
203
194
-
```
204
+
```bash
195
205
croc --yes [code-phrase] > out
196
206
```
197
207
@@ -202,7 +212,7 @@ All of the other text printed to the console is going to `stderr` so it will not
202
212
203
213
Sometimes you want to send URLs or short text. In addition to piping, you can easily send text with `croc`:
204
214
205
-
```
215
+
```bash
206
216
croc send --text "hello world"
207
217
```
208
218
@@ -213,15 +223,15 @@ This will automatically tell the receiver to use `stdout` when they receive the
213
223
214
224
You can use a proxy as your connection to the relay by adding a proxy address with `--socks5`. For example, you can send via a tor relay:
215
225
216
-
```
226
+
```bash
217
227
croc --socks5 "127.0.0.1:9050" send SOMEFILE
218
228
```
219
229
220
230
### Change encryption curve
221
231
222
232
You can choose from several different elliptic curves to use for encryption by using the `--curve` flag. Only the recipient can choose the curve. For example, receive a file using the P-521 curve:
223
233
224
-
```
234
+
```bash
225
235
croc --curve p521 <codephrase>
226
236
```
227
237
@@ -231,23 +241,23 @@ Available curves are P-256, P-348, P-521 and SIEC. P-256 is the default curve.
231
241
232
242
You can choose from several different hash algorithms. The default is the `xxhash` algorithm which is fast and thorough. If you want to optimize for speed you can use the `imohash` algorithm which is even faster, but since it samples files (versus reading the whole file) it can mistakenly determine that a file is the same on the two computers transferring - though this is only a problem if you are syncing files versus sending a new file to a computer.
233
243
234
-
```
244
+
```bash
235
245
croc send --hash imohash SOMEFILE
236
246
```
237
247
238
248
### Self-host relay
239
249
240
250
The relay is needed to staple the parallel incoming and outgoing connections. By default, `croc` uses a public relay but you can also run your own relay:
241
251
242
-
```
252
+
```bash
243
253
croc relay
244
254
```
245
255
246
256
By default it uses TCP ports 9009-9013. Make sure to open those up. You can customize the ports (e.g. `croc relay --ports 1111,1112`), but you must have a minimum of **2** ports for the relay. The first port is for communication and the subsequent ports are used for the multiplexed data transfer.
247
257
248
258
You can send files using your relay by entering `--relay` to change the relay that you are using if you want to custom host your own.
0 commit comments