title: How to rename text files according to their content?
body: <p>My OS is Ubuntu; I have a directory with text files; each file includes a line with unique ID</p>
  
  <p>IDtag IDnumber</p>
  
  <p>The line location is random inside a text file, however, it is easy to recognize it be simple regex </p>
  
  <p>^IDtag ID[0-9]*</p>
  
  <p>How to rename the files according to their IDs? I.e. each file has to obtain a new name IDnumber.txt
  I can run a Linux shell script or Perl script.</p>