# Sorting problem....

**URL:** <https://community.unix.com/t/sorting-problem/172248>\
**Category:** HP-UX\
**Created:** [June 21, 2007, 7:40pm UTC](https://community.unix.com/t/sorting-problem/172248 "2007-06-21T19:40:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jarod004](https://community.unix.com/letter_avatar/jarod004/32/6_22734026db12803ebb3e059622ac3534.png) [@jarod004](https://community.unix.com/u/jarod004)\
**Post date:** [June 21, 2007, 7:40pm UTC](https://community.unix.com/t/sorting-problem/172248/1 "2007-06-21T19:40:37Z")

</div>

hey mate. ive got a sorting problem that i would like to share...

i made a script that sorts the bdf command and redirected the output to a file. the output of the file is:

691416 34% /  
851552 7% /stand  
7203048 31% /var  
23637584 26% /var/adm/crash  
2968864 37% /usr  
1744096 16% /tmp  
2381048 54% /opt  
514848 51% /home  
17% /home/com  
986359 81% /home/appl  
36% /backup\_master  
91% /backup  
8227336 17% /home/com  
2593361 36% /backup\_master  
5903593 91% /backup

please tell me how to sort out the file so that i can remove the ones in  
bold (blue) because they are just copies of the file systems in bold (black).  
please help me...

---

<div class="post-metadata">

**Author:** ![becket](https://community.unix.com/user_avatar/community.unix.com/becket/32/235_2.png) [@becket](https://community.unix.com/u/becket)\
**Post date:** [June 24, 2007, 2:37pm UTC](https://community.unix.com/t/sorting-problem/172248/2 "2007-06-24T14:37:08Z")

</div>

i don't think you really need to sort

```nohighlight
cat file.txt |sed -n '/[0-9]* [0-9]*%/p'

```

---

<div class="post-metadata">

**Author:** ![jarod004](https://community.unix.com/letter_avatar/jarod004/32/6_22734026db12803ebb3e059622ac3534.png) [@jarod004](https://community.unix.com/u/jarod004)\
**Post date:** [June 24, 2007, 6:09pm UTC](https://community.unix.com/t/sorting-problem/172248/3 "2007-06-24T18:09:11Z")

</div>

thanks mate. it works.... do you know how to further sort the output so that only the ones with 80% up are shown

---

<div class="post-metadata">

**Author:** ![anbu23](https://community.unix.com/user_avatar/community.unix.com/anbu23/32/351_2.png) [@anbu23](https://community.unix.com/u/anbu23)\
**Post date:** [June 25, 2007, 12:05am UTC](https://community.unix.com/t/sorting-problem/172248/4 "2007-06-25T00:05:27Z")

</div>

> [@jarod004](#):
>
> thanks mate. it works.... do you know how to further sort the output so that only the ones with 80% up are shown

```plaintext
$ cat file
691416 34% /
851552 7% /stand
7203048 31% /var
23637584 26% /var/adm/crash
2968864 37% /usr
1744096 16% /tmp
2381048 54% /opt
514848 51% /home
17% /home/com
986359 81% /home/appl
36% /backup_master
91% /backup
8227336 17% /home/com
2593361 36% /backup_master
5903593 91% /backup
$ awk -F"[%]" ' $2 > 80 ' file
986359 81% /home/appl
5903593 91% /backup

```

---

<div class="post-metadata">

**Author:** ![jarod004](https://community.unix.com/letter_avatar/jarod004/32/6_22734026db12803ebb3e059622ac3534.png) [@jarod004](https://community.unix.com/u/jarod004)\
**Post date:** [June 25, 2007, 12:42am UTC](https://community.unix.com/t/sorting-problem/172248/5 "2007-06-25T00:42:43Z")

</div>

thanks mate. i also found a nifty syntax that does the same... still, thanks...

cat file|grep [8-9][0-9]%
