Skip to main content
1 of 2
slm
  • 379.8k
  • 127
  • 793
  • 897

You can use grep with the PCRE facility. It's available in most of the newer versions of grep.

$ grep -oP "^(\w{12})" test.txt 
6982a9948422
slm
  • 379.8k
  • 127
  • 793
  • 897