How to use urlencode and urldecode commands directly on Linux
This article mainly explains "how to use urlencode and urldecode commands directly on Linux". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to use urlencode and urldecode commands directly on Linux.
CentOS installation:
Yum install gridsite-clients
Then use it directly:
[root@local ~] # urlencode 'https://www.baidu.com/'https%3A%2F%2Fwww.baidu.com%2F
About the detailed use of the command:
NAME urlencode-convert strings to or from URL-encoded formSYNOPSIS urlencode [- m |-d] string [string...] DESCRIPTION urlencode encodes strings according to RFC 1738. That is, characters Amurz 0-9. _ and-are passed through unmodified, but all other characters are represented as% HH, where HH is their two-digit upper-case hexadecimal ASCII representation. For example, the URL http://www.gridpp.ac.uk/ becomes http%3A%2F%2Fwww.gridpp.ac.uk%2F urlencode converts each character in all the strings given on the command line. If multiple strings are given, they are concatenated with separating spaces before conversion.OPTIONS-m Instead of full conversion, do GridSite "mild URL encoding" in which Amurz 0-9. =-_ @ and / are passed through unmodi- fied. This results in slightly more human-readable strings but the application must be prepared to create or simulate the directories implied by any slashes. -d Do URL-decoding rather than encoding, according to RFC 1738. % HH and% hh strings are converted and other characters are passed through unmodified, with the exception that + is converted to space. At this point, I believe you have a deeper understanding of "how to directly use urlencode and urldecode commands on Linux". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!