sort sampleIDs.txt > sampleIDs_sorted.txt
get unique list of sorted text elements
sort -u sampleIDs.txt > sampleIDs_unique_sorted.txt
Get for each element (word/string) in a list the frequency of it's occurrence (sorted)
# Count the number of repeats for each ID in the list
sort sampleIDs.txt | uniq -c | awk '{print $2"\t"$1}' | sort -rnk 2
Sorting list of files
ls *.txt | sort