title: Write a shell script and list all the user who logged in five minutes ago
body: <p>Write a shell script and list all the user who logged in five minutes ago.<br>
  Suppose not time is 3:12AM , I want to list all the users who logged in at 3:07Am or after 3:07AM<br>
  I tried the following steps<br>
  there is <code>file w.sh</code> which contain the script this <br></p>
  
  <pre><code>Step 1:   `who &gt;&gt;/home/user/log.txt`
  Step 2: now run the script `w.sh ` using `crontab`
  Step 3: `* * * * * /home/user/w.sh`
  </code></pre>
  
  <p>this will run for every minutes every hour everyday every weeks every months<br></p>
  
  <pre><code>Step 4: i want to check for last 5 minutes 
  `cat log.txt |grep "    "`  NOW I 'm STUCK 
  </code></pre>
  
  <p>how to list out all the users <br>
  Please help me. <br>
  Is it possible to make a single script instead of doing all four steps ??</p>