3 ms·
grep 'name = ' ms-litebox-Cargo.lock | wc -l 238 edit: grep 'name = ' ms-litebox-Cargo.lock | sort -u | wc -l 221
by adolph 8mo ago
grep 'name = ' ms-litebox-Cargo.lock | wc -l
238
edit:
grep 'name = ' ms-litebox-Cargo.lock | sort -u | wc -l
221
- dizhn 8mo agoI've always done 'sort | uniq'. Never bothered to check for the the unique flag to sort. Although 'uniq -c' is quite nice to have. -c, --count prefix lines by the number of occurrences
- adolph 8mo agoYeah, to see the packages with multiple versions: grep 'name = ' ms-litebox-Cargo.lock | sort | uniq -c | grep -v '1 name' | sort -n Package windows-sys has the highest number of versions included, 3: 0.59.0, 0.60.2, and 0.61.2. Edit: Also, beware of the unsorted uniq count: cat <<EOF | uniq -c > a > a > b > a > a > EOF 2 a 1 b 2 a
- dundarious 8mo agogrep -v '1 name' excludes 11, 21, etc., but I take your point.