using_grep

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
using_grep [2016/09/06 19:37] walkeradminusing_grep [2023/03/09 22:35] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== Using GREP ====== ====== Using GREP ======
 +<color darkorange>2016</color>
 +\\ 
 \\  \\ 
 \\  \\ 
Line 93: Line 95:
     [    6.716496] bcm2835-wdt 3f100000.watchdog: Broadcom BCM2835 watchdog timer     [    6.716496] bcm2835-wdt 3f100000.watchdog: Broadcom BCM2835 watchdog timer
     [    7.186573] brcmfmac: brcmf_sdio_drivestrengthinit: No SDIO Drive strength init done for chip 43430 rev 1 pmurev 24     [    7.186573] brcmfmac: brcmf_sdio_drivestrengthinit: No SDIO Drive strength init done for chip 43430 rev 1 pmurev 24
 +\\  
 +Display cpu model name: 
 +\\  
 +    cat /proc/cpuinfo | grep -i 'Model' 
 +     
 +    model name      : ARMv7 Processor rev 4 (v7l) 
 +    model name      : ARMv7 Processor rev 4 (v7l) 
 +    model name      : ARMv7 Processor rev 4 (v7l) 
 +    model name      : ARMv7 Processor rev 4 (v7l) 
 +\\  
 +However, above command can be also used as follows without shell pipe: 
 +\\  
 +    grep -i 'Model' /proc/cpuinfo 
 +\\  
 +\\  
 +===== How do I list just the names of matching files? ===== 
 +Use the -l option to list file name whose contents mention main(): 
 +\\  
 +    grep -l 'main' *.c 
 +\\  
 +\\  
 +===== Force grep to display output in colours ===== 
 +Finally, you can force grep to display output in colors, enter: 
 +\\  
 +<color red>Raspbian seems to do this by default</color> 
 +\\  
 +    grep --color pi /etc/passwd 
 \\  \\ 
  
 +
 +    
          
  
using_grep.1473187040.txt.gz · Last modified: 2023/03/09 22:35 (external edit)