Undrestanding sample1d

I have this command in gmt and need to somehow translate it to PYGMT. I have some files that shows the longitude and latitude of the faults. The files start with VRTX and has 5 columns.

I need to undrestand what happens here to be able to draw the fault line in pygmt. Does it sort the data? and what sort means here?

I did not undrestand these lines: sort
-n -k 2

and this one:
gmt sample1d -N3 -T0.025d -AR
-Fc
If I undrestand, I can translate it somehow and draw the line in pygmt. right now the figure doesn’t look good to me. I appreciate a lot if someone can help me to undrestand these lines.

set FILELIST = ' FS_Hay_Cal.ts_deg83 '
     foreach FILE ( $FILELIST )
             echo FILE: $FILE
             $FILE | awk \
             '{ if ( $1 == "VRTX" && $5 >= 0.0 && $5 < 0.5 ) print $3, $4, $5 }' | sort \
             -n -k 2 | awk '{ print $1, $2, $3, NR }' | gmt sample1d -N3 -T0.025d -AR \
             -Fc | gmt psxy -Wthick,red
     end

sort -n -k 2 means numeric sort based on key 2 (that basically means column 2). See sort(1).

thanks a lot