Today I Learned - Rocky Kev

TIL what grep means

POSTED ON:

TAGS:

When you are searching for a specific thing in linux, you may use the

grep

command.

This means "search globally for matches to the regular expression re, and print lines where they are found". There are various command line switches available when using grep that modify the default behavior.

Examples:

To search all files in the current directory for the string "car".

grep car *

To search all files in the current directory and all its subdirectories (recursive) for the string "car".

grep -r car .

(The character "." is a relative path from the current directory to itself.)

This Show all mozilla related processes running.

ps aux | grep mozilla

Find all files containing the word bleh.

grep bleh -R /*


[reference](https://linux.fandom.com/wiki/Grep)

Related TILs

Tagged:

TIL Trovald's Magic Numbers

These magic numbers are intended to safeguard against a typo or potential bit flips in the syscall number. Since reboot is a destructive and non-syncing operation, it's important to make absolutely sure that it isn't called accidentally due to a typo, a misbehaving program, or memory error

TIL linux user groups

UID 0 is reserved for root user. UID 1-99 is reserved for other predefined accounts. UID 100-999 is reserved for system accounts. Also notice that user accounts tend to start at 1000. UID above 999 are for normal user accounts.

TIL How to determine what security group you're in

These commands will help you figure out what group you're in, and if you belong to the group that can modify files.