title: how to compare two files using only one field in the line and outputting the difference and similar
body: <p>I am having a problem comparing the output of all the passwd and shadow file and having an output of both the same and difference using only the username field</p>
  
  <p>I am using the grep command</p>
  
  <p>this is my code so far</p>
  
  <pre><code>grep -f shadowfile.txt passwordfile.txt &gt; same.txt
  grep -Fxvf shadowfile.txt passwordfile.txt &gt; diff.txt
  </code></pre>
  
  <p>I expected the same.txt to have all the users but no entry in the diff one</p>