find (grep) the last few lines of many files in Linux/Unix

find (grep) the last few lines of many files in Linux/Unix

select the last 16 lines of multiple files

tail  -n 16 sample*|grep chrome
       0   10012       0 ?        12:31:31 C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
       0   12448       0 ?        12:45:53 C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
       0    9768       0 ?        12:46:03 C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
       0   14276       0 ?        15:09:37 C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
       0   13516       0 ?        15:27:26 C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
       0   11352       0 ?        15:27:29 C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
       0   10264       0 ?        16:01:08 C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
       0    2280       0 ?          Aug  5 C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
   

 grep for a keyword and display the name of the files


➤ grep -r conhost  sample*
sample.lst:       0    5524       0 ?          Aug  5 C:\Windows\System32\conhost.exe
sample.lst:       0    6152       0 ?          Aug  5 C:\Windows\System32\conhost.exe
sample.lst:       0    6196       0 ?          Aug  5 C:\Windows\System32\conhost.exe
sample.lst:       0    6500       0 ?          Aug  5 C:\Windows\System32\conhost.exe
sample.lst:       0   12836       0 ?        10:56:36 C:\Windows\System32\conhost.exe
sample.lst:       0   13296       0 ?        16:09:31 C:\Windows\System32\conhost.exe
sample.lst:       0   13816       0 ?        16:09:31 C:\Windows\System32\conhost.exe
sample1.lst:       0   13816       0 ?        16:09:31 C:\Windows\System32\conhost.exe
sample1.lst:       0   13296       0 ?        16:09:31 C:\Windows\System32\conhost.exe
sample1.lst:       0   12836       0 ?        10:56:36 C:\Windows\System32\conhost.exe
sample1.lst:       0   12012       0 ?          Aug  6 C:\Windows\System32\conhost.exe
sample1.lst:       0   10764       0 ?          Aug  6 C:\Windows\System32\conhost.exe
sample1.lst:       0    9112       0 ?          Aug  5 C:\Windows\System32\conhost.exe
 
                                                                                                                                                                                       

No comments:

Post a Comment