by andrewrn · 1y ago · 0 comments
Does anyone have tips for how to make it more useful? Maybe I could grep better for options? For example in the link, the author lists out common curl commands like making a POST request or adding a header. If you tried to look through the manpage for this, this would take a long time.
There's another utility called tldr that does a better job of this by providing common usage examples that almost always instantly give me what I need, but its not nearly as comprehensive as man.
function cheat() { curl cht.sh/$1 }
Then in terminal you can use the following to see the examples: $ cheat curl
You can search a man page by pressing the '/' key, typing in what you want, and pressing 'enter'. 'n' jumps to the next instance of your search string 'N' jumps to the previous instance.
For example, I just was digging into BSD_auth and authenticate, and I don't know much about how auth works generally. I found it pretty tough to grok from the man page. I love the idea of learning everything from directly within the system and man pages, but I might just not be smart enough for that.
I agree that they are daunting and not so helpful for users who are new to the command or topic. They usually lack a quick-start guide with examples that give the user a starting point to build upon.
Anyhow, after hearing about `tldr` for close to a decade, your comment inspired me to install it. When I tried running `tldr curl`, I was delighted to learn something new and useful:
# Resolve a hostname to a custom IP address, with verbose output (similar to editing the /etc/hosts file for custom DNS resolution):
curl --verbose --resolve example.com:80:127.0.0.1 http://example.com