Use curl -K or curl --config followed by a filename to load reusable curl options from a text file. Put one option per line; put a URL in the file with the url option, not as a bare URL. For example, save options in curl-options.txt and run curl --config curl-options.txt. This guide shows how to write the file, control curl’s automatically loaded defaults, and troubleshoot common problems.
Make and run a curl config file
A curl config file is a text file containing options that curl applies to a request. The curl man page explains that arguments in the file are used as if they had been supplied on the command line (curl man page, -K, --config). That lets you keep recurring settings out of a long command and reuse them across invocations.
1. Create the file
Save this example as curl-options.txt in your current directory:
# Reusable request options
fail
show-error
user-agent = "my script/1.0"
url = "https://example.com/"
The first non-blank character on a comment line must be #. Each option belongs on its own physical line, and an option with its parameter stays on that same line. Use url = "https://example.com/" to provide the request URL; a URL written by itself is not the documented config-file form.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →#1 Best Overall
- KEYBOARD: The keyboard works for Windows with hot keys that enable easy access to Media, My Computer, Mute, Volume up/down, and Calculator
- EASY SETUP: Experience simple installation with the USB wired connection
- VERSATILE COMPATIBILITY: This keyboard is designed to work with multiple Windows versions, including Vista, 7, 8, 10 offering broad compatibility across devices.
- SLEEK DESIGN: The elegant black color of the wired keyboard complements your tech and decor, adding a stylish and cohesive look to any setup without sacrificing function.
- FULL-SIZED CONVENIENCE: The standard QWERTY layout of this keyboard set offers a familiar typing experience, ideal for both professional tasks and personal use.
2. Tell curl to load it
From the directory containing the file, run:
curl --config curl-options.txt
The short form works too:
curl -K curl-options.txt
Use a path if the file is elsewhere, such as curl --config ./config/curl-options.txt. The filename is your choice; it does not have to be .curlrc. If the request URL is already in the config file, you do not need to add it again on the command line.
Write options and values with the right syntax
Config syntax resembles curl’s command-line options, but the separators and quoting rules matter. When starting out, prefer an option name without its leading dashes and use = between an option and its value, as in user-agent = "my script/1.0". For options that take no value, put the option name alone on its line, as with fail and show-error.
Spaces, separators, and dashes
The man page permits documented forms using whitespace, a colon, or an equals sign, but the available separators depend on whether the option is written with leading dashes. Do not assume every combination is interchangeable. To reduce ambiguity, use the simple forms above: an undashed option name with = for a value, or an undashed flag on its own line. If you choose dashed option names or another separator style, follow the exact syntax in the current curl man page.
Quote values that need it
Enclose a parameter in double quotes if it contains whitespace or starts with : or =. For instance:
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Rank #2
- Reliable Plug and Play: The USB receiver provides a reliable wireless connection up to 33 ft (1), so you can forget about drop-outs and delays and you can take it wherever you use your computer
- Type in Comfort: The design of this keyboard creates a comfortable typing experience thanks to the low-profile, quiet keys and standard layout with full-size F-keys, number pad, and arrow keys
- Durable and Resilient: This full-size wireless keyboard features a spill-resistant design (2), durable keys and sturdy tilt legs with adjustable height
- Long Battery Life: MK270 combo features a 36-month keyboard and 12-month mouse battery life (3), along with on/off switches allowing you to go months without the hassle of changing batteries
- Easy to Use: This wireless keyboard and mouse combo features 8 multimedia hotkeys for instant access to the Internet, email, play/pause, and volume so you can easily check out your favorite sites
user-agent = "My batch client/2.1"
Within double quotes, curl documents these escapes: \ for a backslash, " for a double quote, and t, n, r, and v for tab, newline, carriage return, and vertical tab. A backslash before other letters is ignored, so do not rely on it to escape arbitrary characters. If a value contains complicated quoting or line breaks, consult the man page before putting it into a config file.
Keep lines manageable
Use one option per physical line and keep its parameter on the same line. Since curl 8.2.0, the man page specifies a maximum config line length of 10 megabytes; ordinary option lines should be far shorter. Breaking a value across lines can change how it is parsed, so do not use line wrapping as a substitute for correct quoting.
Choose between an explicit file and curl’s default config
There are two ways config settings can enter a request: you can name a file for one invocation, or curl can discover a default config file when it starts. The default is commonly named .curlrc, with Windows-specific naming and path variations. The current lookup order depends on the environment and platform, so use the installed curl version’s man page when you need to identify the exact file read on a particular machine.
| Approach | Scope | Where settings come from | When it helps |
|---|---|---|---|
--config file or -K file |
The invocation where you specify it | The path you provide | You want the command’s settings to be visible and repeatable. |
| Automatically discovered default config | Potentially every curl invocation for that user or environment | A platform- and environment-dependent lookup | You deliberately want personal defaults applied broadly. |
Specifying --config does not, by itself, turn off the default config. That distinction matters on shared machines, in scripts, and when a command behaves differently on two computers: the explicit file may be the same while a user’s default file adds settings.
Rank #3
- All-day Comfort: The design of this standard keyboard creates a comfortable typing experience thanks to the deep-profile keys and full-size standard layout with F-keys and number pad
- Easy to Set-up and Use: Set-up couldn't be easier, you simply plug in this corded keyboard via USB on your desktop or laptop and start using right away without any software installation
- Compatibility: This full-size keyboard is compatible with Windows 7, 8, 10 or later, plus it's a reliable and durable partner for your desk at home, or at work
- Spill-proof: This durable keyboard features a spill-resistant design (1), anti-fade keys and sturdy tilt legs with adjustable height, meaning this keyboard is built to last
- Plastic parts in K120 include 51% certified post-consumer recycled plastic*
Disable default config for a predictable run
Put -q or --disable first on the command line, before any other command-line parameter, when you do not want curl to read its default config. For example:
curl -q --config curl-options.txt
Here, curl skips its automatically discovered default file but still reads the explicitly named curl-options.txt. The curl tutorial describes -q as the way to prevent reading the default file (curl tutorial, “Config File”). Moving -q later in the command is not equivalent to placing it first.
Use multiple config files or read from standard input
You can specify --config more than once when settings are split across files. For example:
curl -q --config common-options.txt --config one-request.txt
This pattern can separate reusable settings from request-specific settings. Keep track of which files each script loads so the effective request configuration remains understandable.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesRank #4
- 【Dreamy Rainbow Gaming Keyboard】K521 Gaming Keyboard Adopts a Different LED Backlight Design, Upgraded on the Traditional LED Backlight Effect, Making the Light More Penetrating, Giving You a More Dazzling Visual Effect, Making Your Gaming Process More Enjoyable
- 【One Touch Opens & Visual Feast】The K521 Red Dragon Keyboard has a One-Touch on/off Lighting Button for Added Convenience. It also has a Three-Position Adjustable Breathing Mode and a Four-Position Adjustable Brightness Lighting Mode
- 【Mechanical Feeling & Fast Tapping】The PC Keyboard Keys are Designed for Mechanical Feeling, Giving You a Better Feel During Use and the Ability to Trigger Keys Quickly, Allowing You to Win All Your Games
- 【19 Keys Anti-Ghosting Keyboard】Anti-Ghosting Ensures Every Button Can Be Triggered. This Allows You to Trigger Key Combinations In The Game Accurately, And Each Skill Can Be Accurately Released to Increase Your Winning Rate. Redragon K521 Will Be Your Perfect Partner
- 【12 Multimedia Combination Keys】The K521 Wired Gaming Keyboard is Equipped with 12 Multimedia Keys That Can Greatly Enhance Your Gaming/Office Efficiency and Make It More Convenient to Use
To read config text from standard input, use a single hyphen as the filename:
printf 'url = "https://example.com/"n' | curl -q --config -
The tutorial also demonstrates piping a config line to curl -K - (curl tutorial). Standard input can keep an option out of the visible command text, but it is not a security boundary: secrets can still be exposed through logs, shell history, process handling, or unsafe storage. Do not put credentials in a shared config file unless its access controls are appropriate.
Adapt a config file to recurring requests
A config file is useful when repeated invocations share options, but it should remain clear which values are common and which are request-specific. For example, a reusable timeout and proxy can be written like this:
# Set a 30-minute timeout
-m 1800
# Use a proxy
proxy = proxy.our.domain.example.com:8080
This follows the curl tutorial’s illustrative timeout-and-proxy pattern; change the values to suit your environment. The tutorial’s -m 1800 means 1,800 seconds, or 30 minutes. Do not copy a proxy host from an example unless it is the proxy you intend to use.
Best Value
- All-day Comfort: This USB keyboard creates a comfortable and familiar typing experience thanks to the deep-profile keys and standard full-size layout with all F-keys, number pad and arrow keys
- Built to Last: The spill-proof (2) design and durable print characters keep you on track for years to come despite any on-the-job mishaps; it’s a reliable partner for your desk at home, or at work
- Long-lasting Battery Life: A 24-month battery life (4) means you can go for 2 years without the hassle of changing batteries of your wireless full-size keyboard
- Simply plug the USB receiver into a USB port on your desktop, laptop or netbook computer and start using the keyboard right away without any software installation
- Simply Wireless: Forget about drop-outs and delays thanks to a strong, reliable wireless connection with up to 33 ft range (5); K270 is compatible with Windows 7, 8, 10 or later
Keep secrets and environment-specific values deliberate
A config file makes options reusable; it does not make their contents private. Before committing one to a repository, sharing it, or placing it where other users can read it, check whether it contains credentials or machine-specific proxy settings. The stdin approach can avoid displaying a value directly in the curl command text, but the value may still appear elsewhere in the execution or logging path.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshoot config-file problems
- The file is not found: Check the spelling and the path relative to the directory where the command runs. Use an explicit path such as
curl --config ./config/curl-options.txtto avoid relying on the current directory. - The URL is not being used: Add it as an option, for example
url = "https://example.com/". Do not put only the URL on a line. - A value with spaces is parsed incorrectly: Put the value in double quotes and keep the option and value on the same physical line.
- A run differs between machines: Check whether curl is also loading a default config. Use
curl -q --config curl-options.txtfor a run that should use only the explicit config and command-line options. - An option or separator is rejected: Check the installed curl version and the exact option spelling and config syntax in its man page. The dashed and undashed forms do not make every separator valid.
- A config line is unusually long: Split the settings into separate options on separate physical lines where possible; do not split one option and its parameter across lines. The documented maximum is 10 megabytes per line for curl 8.2.0 and later.
- Input from a pipe is not read as expected: Use
-as the filename in-K -or--config -, and make sure the piped text follows config-file syntax.
For version-specific details, check curl --version and consult the corresponding installed manual or the rolling online curl man page. The online manual changes as curl releases change, so it may describe options not present in an older local installation.
Or skip the browser setup
If the recurring job is to capture website screenshots rather than manage browser automation locally, ScreenshotNeo provides a screenshot API: one GET request with a URL returns a PNG, JPEG, WebP, or PDF. This is a separate shortcut from configuring curl itself. Its screenshot API accepts a single curl call, and the ScreenshotNeo API documentation covers the available parameters.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Replace YOUR_API_KEY with your key and change the target URL as needed. ScreenshotNeo accepts cookie or consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each of those steps can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report the page verdict and billing status. An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients. Plans include 1,000 shots per month free with no card; paid plans start at $5 for 3,000 shots.
Sign up for ScreenshotNeo’s free plan: 1,000 screenshots a month, no card required.
What to remember about curl config files
Use --config or -K to name the file explicitly, write one option per line, and express the URL with the url option. If you need a command unaffected by an automatically discovered default config, put -q first. Those choices make the request inputs easier to identify and reproduce.
Frequently Asked Questions
Does a curl config file have to be named .curlrc?
No. Any filename works when you load it explicitly with -K or –config; .curlrc is commonly used for curl’s automatically discovered default file.
Can a curl config file contain more than one URL?
The config format accepts curl options, including url. For the exact behavior of multiple URL options and other transfer-related settings in your curl version, consult its man page.
Free tools Windows power users keep installed
One-click scans. No signup required.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

