Learning to Manipulate YAML on the Command Line with YQ

<p>You are probably familiar with &ldquo;jq&rdquo;. Every developer or DevOps must have handled JSON data. &ldquo;jq&rdquo; is a lightweight and flexible command-line JSON processor akin to sed, awk, and grep. Those linux commands like sed, awk, and grep are awesome tools, but when you are working on formatted data like JSON or YAML, a private library that is developed for this format can be a better solution because you do not have to write complex linux command syntaxes.</p> <p>&ldquo;yq&rdquo; is a lightweight and portable command-line YAML, JSON, and XML processor. &ldquo;yq&rdquo; uses &ldquo;jq&rdquo; as syntax but works with YAML files as well as JSON, XML, properties, CSV, and TSV. When you search for &ldquo;yq&rdquo;, you can find two repositories. But the &ldquo;yq&rdquo; tool we refer to in this article is mikefarah/yq, not &ldquo;kislyuk/yq. When you try to install yq from the Ubuntu Snap repository, &ldquo;mikefarah/yq&rdquo; will be installed. The version needs to be &quot;4.x&quot; which is crucial. There are huge differences between &ldquo;3.x&rdquo; and &ldquo;4.x&rdquo;.</p> <p><a href="https://baturorkun.medium.com/learning-to-manipulate-yaml-on-the-command-line-with-yq-531268d8805d"><strong>Read More</strong></a></p>
Tags: Command Line