문제

I want to know what is this command do?

In addition, the 'who | grep > /dev/null' in this loop why must return true or false:

until who | grep “Milad” > /dev/null
do
   sleep 60
done
도움이 되었습니까?

해결책

This will wait until a user named "Milad" is logged in.

who gets the list of logged in users, grep "Milad" filters the list returned by who for entries that contain Milad. This will return "true" if the entry was found. To suppress any output, it is redirected to the digital toilet (> /dev/null). The whole thing then loops while there is no user Milad, sleeping 60 seconds between each test.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top