Search code examples
unixterminalls

Show file list with sorting by links count in Unix


How can I show file list with sorting by hard links count in Unix terminal (Mac OS)?

ls -l shows this data in second column. By how can I sort by this column?

Thanks


Solution

  • ls -l | sort -n -k 2 should work for you.