Remove duplicate items from an array.
Section: Arrays and Objects
Unique values
bash
bash
echo '[3,1,2,3,2]' | jq 'unique'Explanation
`unique` sorts and deduplicates.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Arrays and Objects