What does the -i (include) flag mean in a curl command?
If you’ve ever used the curl command in your terminal before, then you’ve probably seen it coupled with a flag or two.
But before we go on, if you’re unfamiliar with curl, then let’s read an explanation from its man page:
curl is a tool for transferring data from or to a server. It supports these protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET or TFTP. The command is designed to work without user interaction.
curl offers a busload of useful tricks like proxy support, user authentication, FTP upload, HTTP post, SSL connections, cookies, file transfer resume and more. As you will see below, the number of features will make your head spin.
I like that “will make your head spin” is in the man page. That’s a nice touch.
But let’s go on with what you came here for.
In this article, we’ll go over one of them that may have popped up for you: the -i
flag.
For example, let’s say you did this:
curl -i tremaineeto.medium.com
What exactly does that -i
mean? Is it necessary?