trurl is a command-line utility for parsing, constructing and manipulating URLs. Developed within the curl project, it uses the URL parsing functionality provided by libcurl to interpret addresses consistently with curl itself. The software is particularly useful for shell scripts that need to generate addresses, extract particular URL components or modify existing URLs without relying on complicated regular expressions.
The utility operates on hierarchical URLs as defined by RFC 3986, with extensions provided by libcurl. It treats the individual elements of an address independently, allowing scripts to modify specific components without disturbing unrelated information. trurl works with URL strings rather than transferring data over a network, making it a complementary utility to curl rather than a replacement for it.
This is free and open source software.
Key Features
- Extract individual URL components, including scheme, hostname, port, path, query, fragment, credentials and IPv6 zone identifier.
- Construct new URLs from independently specified components.
- Replace, remove or conditionally populate individual components.
- Append path segments and query parameters with appropriate URL encoding.
- Remove query parameters by exact name or matching prefix, useful for stripping tracking parameters.
- Replace query parameter values and sort parameters alphabetically.
- Support alternative query parameter separators.
- Resolve relative redirects against a base URL.
- Normalise URLs, including percent encoding and redundant path segments.
- Handle internationalised domain names and Punycode conversion.
- Extract default port numbers for recognised protocols.
- Generate combinations of URLs by iterating over component values.
- Process multiple URLs from command-line arguments, files or standard input.
- Customisable formatted output and structured JSON output.
- Strict URL validation and configurable error handling.
- Cross-platform support – runs on Linux, macOS, and Windows.
Website: github.com/curl/trurl
Support:
Developer: Daniel Stenberg and contributors
License: curl License
trurl is written in C. Learn C with our recommended free books and free tutorials.
LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more. Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion. Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README. |



Please read our Comment Policy before commenting.