BASH_SRV Telegram 129
Иногда нужно быстро найти и подсветить все IPv4-адреса в логах или текстовых файлах. Для этого отлично подходит регулярное выражение + grep.


grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}' access.log


🔎 Что здесь происходит:

-E — включает расширенные регулярки.
-o — выводит только совпадения, без остальной строки.
([0-9]{1,3}\.){3}[0-9]{1,3} — шаблон поиска IPv4-адреса.

📌 Чтобы сразу убрать дубликаты и отсортировать список IP:


grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}' access.log | sort -u


Это удобно при анализе логов Nginx/Apache или при поиске подозрительных подключений.

👉@bash_srv
👍8



tgoop.com/bash_srv/129
Create:
Last Update:

Иногда нужно быстро найти и подсветить все IPv4-адреса в логах или текстовых файлах. Для этого отлично подходит регулярное выражение + grep.


grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}' access.log


🔎 Что здесь происходит:

-E — включает расширенные регулярки.
-o — выводит только совпадения, без остальной строки.
([0-9]{1,3}\.){3}[0-9]{1,3} — шаблон поиска IPv4-адреса.

📌 Чтобы сразу убрать дубликаты и отсортировать список IP:


grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}' access.log | sort -u


Это удобно при анализе логов Nginx/Apache или при поиске подозрительных подключений.

👉@bash_srv

BY Bash Советы




Share with your friend now:
tgoop.com/bash_srv/129

View MORE
Open in Telegram


Telegram News

Date: |

Earlier, crypto enthusiasts had created a self-described “meme app” dubbed “gm” app wherein users would greet each other with “gm” or “good morning” messages. However, in September 2021, the gm app was down after a hacker reportedly gained access to the user data. Channel login must contain 5-32 characters Hui said the time period and nature of some offences “overlapped” and thus their prison terms could be served concurrently. The judge ordered Ng to be jailed for a total of six years and six months. Ng Man-ho, a 27-year-old computer technician, was convicted last month of seven counts of incitement charges after he made use of the 100,000-member Chinese-language channel that he runs and manages to post "seditious messages," which had been shut down since August 2020. The channel also called on people to turn out for illegal assemblies and listed the things that participants should bring along with them, showing prior planning was in the works for riots. The messages also incited people to hurl toxic gas bombs at police and MTR stations, he added.
from us


Telegram Bash Советы
FROM American