title: Linux: list unique part of file name
body: <p>I have about 50K files is a directory (linux OS) and they have naming convention as <strong>USER_ID.ORACLE_JOB_ID.SEQUENCED_NUMBER.pdf</strong></p>
  
  <p>I need to list all unique ORACLE_JOB_ID in a text file. How can this be done?</p>
  
  <p>PS: Forgot to mention that there are some other files in same directory which have different naming convention and I have to avoid them.</p>
  
  <p>Thanks!</p>
  
  <p>Examples:
  1.6778390.done
  2.o6778390.out
  3.AWRX_GBL_FAR1.98567432.4.dat.xml
  <strong>4.AWRX_GBL_FAR1.34789214.4.pdf</strong></p>