How to know the command or function for a particular task ?

commandline session

$man -k sort
alphasort (3)        - scan a directory for matching entries
apt-sortpkgs (1)     - Utility to sort package index files
bsearch (3)          - binary search of a sorted array
bunzip2 (1)          - a block-sorting file compressor, v1.0.6
bzip2 (1)            - a block-sorting file compressor, v1.0.6
comm (1)             - compare two sorted files line by line
FcFontSetSort (3)    - Add to a font set
FcFontSetSortDestroy (3) - DEPRECATED destroy a font set
FcFontSort (3)       - Return list of matching fonts
qsort (3)            - sort an array
qsort_r (3)          - sort an array
sort (1)             - sort lines of text files
sq (1)               - squeeze or unsqueeze a sorted word list
texindex (1)         - sort Texinfo index files
tsort (1)            - perform topological sort
unsq (1)             - squeeze or unsqueeze a sorted word list
versionsort (3)      - scan a directory for matching entries
XConsortium (7)      - X Consortium information
$