BASH_SRV Telegram 84
🕵️‍♂️ Мониторим новые файлы в каталоге в реальном времени

Иногда нужно узнать, когда в определённой папке появляются новые файлы. Bash + inotifywait помогут:


inotifywait -m -e create --format '%w%f' /path/to/dir | while read NEWFILE; do
echo "🆕 Новый файл: $NEWFILE"
done


📦 Объяснение:

* inotifywait -m — постоянный мониторинг
* -e create — событие создания
* --format '%w%f' — полный путь к новому файлу
* /path/to/dir — нужная папка
* Всё новое сразу отображается в консоли

Установить inotify-tools:


sudo apt install inotify-tools


👉@bash_srv
👍9



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

🕵️‍♂️ Мониторим новые файлы в каталоге в реальном времени

Иногда нужно узнать, когда в определённой папке появляются новые файлы. Bash + inotifywait помогут:


inotifywait -m -e create --format '%w%f' /path/to/dir | while read NEWFILE; do
echo "🆕 Новый файл: $NEWFILE"
done


📦 Объяснение:

* inotifywait -m — постоянный мониторинг
* -e create — событие создания
* --format '%w%f' — полный путь к новому файлу
* /path/to/dir — нужная папка
* Всё новое сразу отображается в консоли

Установить inotify-tools:


sudo apt install inotify-tools


👉@bash_srv

BY Bash Советы




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

View MORE
Open in Telegram


Telegram News

Date: |

1What is Telegram Channels? The court said the defendant had also incited people to commit public nuisance, with messages calling on them to take part in rallies and demonstrations including at Hong Kong International Airport, to block roads and to paralyse the public transportation system. Various forms of protest promoted on the messaging platform included general strikes, lunchtime protests and silent sit-ins. Telegram Android app: Open the chats list, click the menu icon and select “New Channel.” Telegram channels fall into two types: How to build a private or public channel on Telegram?
from us


Telegram Bash Советы
FROM American