snarf(1)
π snarf(1) π
okay bestie, sit down, hydrate, and let me tell you about snarf β the Simple Non-interactive All-purpose Resource Fetcher, aka your new manual-page bestie from the General Commands Manual. no cap, this thing is lowkey iconic. π¦
β¨ NAME β¨
snarf β Simple Non-interactive All-purpose Resource Fetcher
πΈ SYNOPSIS πΈ
snarf [-avqprzm] URL [outfile] ...
likeβ¦ that's it. that's the whole vibe. URLs go in, data comes out. π
π DESCRIPTION π
snarf goes and gets data for you from a bunch of protocols, namely http, ftp, and gopher. that's the whole job. it fetches. it snarfles. it slays. β¨
π«Ά USAGE π«Ά
so the way you use it: you hit snarf with any number of URLs and outfiles. yes, plural, go off. π
if you don't give it an outfile, snarf is a sweetie and preserves the remote file name when saving. so like:
snarf http://foo.bar.com/images/face.gif
will pull down that file ``face.gif'' onto your local system. cute! π
but β and this is the plot twist β if there's no filename at all (the url just ends in a slash), snarf still grabs the data and stashes it in a default file depending on the protocol:
index.htmlfor http URLsftpindex.txtfor ftp URLsgopherindex.txtfor gopher URLs
now, if you use a dash, "-", as the outfile? snarf sends its output straight to stdout instead of a file. perfect for piping, periodt. π
wanna log in to an ftp server or a website that's gatekeeping with a username and password? use this syntax:
http://username:password@site.com/
and if you omit the password, snarf will prompt you for it. it's polite like that. π«Ά
oh and the cutest part: snarf has a built-in option to download the latest version of itself. just run:
snarf LATEST
self-care, honestly. π
π OPTIONS π
reminder bestie: each option only affects the URL that immediately follows it. if you want an option to affect all URLs that follow it, use an uppercase letter for the option, e.g. -Q instead of -q. yes, that's real. yes, it's giving main character energy. β
-aβ makessnarfuse "active" ftp. by defaultsnarfuses passive ftp, and if the server doesn't support it, it falls back to active ftp. using-awill skip that whole initial passive attempt. no time wasted. π¨-rβ resumes an interrupted ftp or http transfer by checking if there's a local file with the same name as the remote file, then starting the transfer at the end of the local file and continuing until it's finished. > β οΈ heads up: this option only works with HTTP servers that understand HTTP/1.1 and ftp servers that support the REST command. alsosnarfuses this option automatically if the outfile already exists. she's proactive.-nβ don't resume. ignore the outfile if it exists and re-transfer it in its entirety. full reset, fresh start, we love a clean slate. πΈ-qβ don't print progress bars. silence is golden. π€«-pβ forces printing of progress bars. here's the tea:snarfhas a compile-time option for whether progress bars print by default or not. the-poption overrides-q. also, if progress bars are enabled by default,snarfsuppresses them when standard output is not a terminal. using-pwill override this behavior too. she does what she wants. π-vβ prints all messages that come from the server to stderr. the full tea, unfiltered. β-zβ send a user-agent string similar to what Netscape Navigator 4.0 uses. throwback era, we love her. π¦-mβ send a user-agent string similar to what Microsoft Internet Explorer uses. yes, that one. π«£
π ENVIRONMENT π
snarf checks several environment variables when deciding what to use for a proxy. the order is so important, bestie β she checks a service-specific variable first, then SNARF_PROXY, then PROXY. priority queen. π
the service-specific variables are:
HTTP_PROXYFTP_PROXYGOPHER_PROXY
snarf also checks the SNARF_HTTP_USER_AGENT environment variable and will use it when reporting its user-agent string to an HTTP server. and in the same spirit, she also uses the SNARF_HTTP_REFERER environment variable to spoof a Referer to the web server. sneaky. iconic. π
π BUGS π
Bugs? What bugs? π if you find 'em, report 'em. that's the whole policy. fr fr.
π AUTHOR π
Copyright (C) 2000 Zachary Beane (xach@xach.com)
and that's the whole page bestie β snarf(1), dated 17 Jun 2000, straight out of the General Commands Manual. go forth, fetch responsibly, and remember: if the transfer gets interrupted, you've always got -r. πβ¨π
π¦ where this page comes from
- debian bookworm: snarf 7.0-9+b1 Β· GPL-2.0-only
- ubuntu jammy: snarf 7.0-9 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms