1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-17 05:58:01 +00:00

Compare commits

...

3 Commits

Author SHA1 Message Date
Mohammad Alyetama
196b811f68 Merge bc767a0ad3 into 594ec08636 2024-10-07 23:05:59 +08:00
jbranchaud
594ec08636 Add Download A File With Curl as a Unix TIL 2024-10-04 12:46:21 -05:00
Mohammad Alyetama
bc767a0ad3 Update bew cask command 2022-11-24 17:49:13 -05:00
3 changed files with 26 additions and 2 deletions

View File

@@ -10,7 +10,7 @@ pairing with smart people at Hashrocket.
For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186).
_1451 TILs and counting..._
_1452 TILs and counting..._
---
@@ -1387,6 +1387,7 @@ _1451 TILs and counting..._
- [Display The Contents Of A Directory As A Tree](unix/display-the-contents-of-a-directory-as-a-tree.md)
- [Do A Dry Run Of An rsync](unix/do-a-dry-run-of-an-rsync.md)
- [Do Not Overwrite Existing Files](unix/do-not-overwrite-existing-files.md)
- [Download A File With Curl](unix/download-a-file-with-curl.md)
- [Enable Multi-Select Of Results With fzf](unix/enable-multi-select-of-results-with-fzf.md)
- [Exclude A Command From The ZSH History File](unix/exclude-a-command-from-the-zsh-history-file.md)
- [Exclude A Directory With Find](unix/exclude-a-directory-with-find.md)

View File

@@ -0,0 +1,23 @@
# Download A File With Curl
Though I typically think of cURL as a way of hitting an API endpoint to check
its headers or see what it returns, it can also be used as an alternative to
`wget` to download a file.
With the `-O` option (short for `--remote-name`) we instruct cURL to save the
contents of the remote file to a local file in the current directory _using the
same name as the remote_.
Here is an example:
```bash
$ curl -O https://www.apache.org/dist/db/derby/db-derby-10.17.1.0/db-derby-10.17.1.0-bin.zip.asc
```
This creates a file in my current directory called
`db-derby-10.17.1.0-bin.zip.asc`. Notice it only uses the last part of the path
for the file name.
See `man curl` for more details.
[source](https://stackoverflow.com/questions/4572153/os-x-equivalent-of-linuxs-wget#comment84857090_4572158)

View File

@@ -6,7 +6,7 @@ convert it using the `ebook-convert` binary from `Calibre`.
First, install `Calibre`:
```bash
$ brew cask install calibre
$ brew install --cask calibre
```
Then convert your ePub using `ebook-convert`: