User Tools

Site Tools


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 revisionBoth sides next revision
using_grep [2016/09/06 19:37] walkeradminusing_grep [2016/09/06 19:44] walkeradmin
Line 93: Line 93:
     [    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.txt · Last modified: 2023/03/09 22:35 by 127.0.0.1