# Uniq tag

**URL:** <https://community.unix.com/t/uniq-tag/298649>\
**Category:** macOS\
**Created:** [November 5, 2011, 11:37pm UTC](https://community.unix.com/t/uniq-tag/298649 "2011-11-05T23:37:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![palex](https://community.unix.com/letter_avatar/palex/32/5_5575768a8748004e209b776fc1b2916d.png) [@palex](https://community.unix.com/u/palex)\
**Post date:** [November 5, 2011, 11:37pm UTC](https://community.unix.com/t/uniq-tag/298649/1 "2011-11-05T23:37:23Z")

</div>

Hello,  
I have recently imported all my scripts into OS X. There is one unix command that is problematic in the new environment:

```nohighlight
sort temp7.txt | uniq -u -w4 > temp8.txt

```

The system doesn't seem to like the -w tag. Is there an alternative command?  
Here is the objective:

Data:

```nohighlight
1234 aaa bbb
2345 www eee
3456 rrr ttt
4567 ttt yyy
2345

```

Output:

```nohighlight
1234 aaa bbb
3456 rrr ttt
4567 ttt yyy

```

Thanks!

---

<div class="post-metadata">

**Author:** ![jim\_mcnamara](https://community.unix.com/letter_avatar/jim_mcnamara/32/5_5575768a8748004e209b776fc1b2916d.png) [@jim\_mcnamara](https://community.unix.com/u/jim_mcnamara)\
**Post date:** [November 6, 2011, 7:02am UTC](https://community.unix.com/t/uniq-tag/298649/2 "2011-11-06T07:02:21Z")

</div>

```nohighlight
sort -u -k 1.1,1.4 temp7.txt

```

Try that.
