# Sorting problem

**URL:** <https://community.unix.com/t/sorting-problem/321599>\
**Category:** UNIX for Advanced & Expert Users\
**Created:** [December 19, 2012, 4:16pm UTC](https://community.unix.com/t/sorting-problem/321599 "2012-12-19T16:16:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mirwasim](https://community.unix.com/letter_avatar/mirwasim/32/5_5575768a8748004e209b776fc1b2916d.png) [@mirwasim](https://community.unix.com/u/mirwasim)\
**Post date:** [December 19, 2012, 4:16pm UTC](https://community.unix.com/t/sorting-problem/321599/1 "2012-12-19T16:16:06Z")

</div>

I have data like this in file

Now I have to sort using second column(usage) and i should get first column against it post sorting

please provide input

---

<div class="post-metadata">

**Author:** ![Yoda](https://community.unix.com/user_avatar/community.unix.com/yoda/32/2498_2.png) [@Yoda](https://community.unix.com/u/Yoda)\
**Post date:** [December 19, 2012, 4:29pm UTC](https://community.unix.com/t/sorting-problem/321599/2 "2012-12-19T16:29:36Z")

</div>

```nohighlight
sort -k2 filename

```

---

<div class="post-metadata">

**Author:** ![mirwasim](https://community.unix.com/letter_avatar/mirwasim/32/5_5575768a8748004e209b776fc1b2916d.png) [@mirwasim](https://community.unix.com/u/mirwasim)\
**Post date:** [December 19, 2012, 4:42pm UTC](https://community.unix.com/t/sorting-problem/321599/3 "2012-12-19T16:42:26Z")

</div>

Thank you this was helpful
