Monitor Files
Method 1 - ls loop
#!/bin/bash
while true
do
file=$(ls -1A /tmp/SSH)
if [ $(ls -1A /tmp/SSH| wc -l) -gt 0 ]
then
cat /tmp/SSH/$file
exit 1
fi
doneMethod 2 - while cat
Watch for a new file:
> while : ; do ls -At /tmp | head -n1; sleep 1; done
Cat the new file:
> while : ; do cat '/tmp/flag.txt' 2>/dev/null; sleep 1; doneWatch jobs
Watch Proc - "procmon":
Last updated