![오늘 두 날짜 사이에 로그인한 사용자 표시 [닫기]](https://linux55.com/image/205925/%EC%98%A4%EB%8A%98%20%EB%91%90%20%EB%82%A0%EC%A7%9C%20%EC%82%AC%EC%9D%B4%EC%97%90%20%EB%A1%9C%EA%B7%B8%EC%9D%B8%ED%95%9C%20%EC%82%AC%EC%9A%A9%EC%9E%90%20%ED%91%9C%EC%8B%9C%20%5B%EB%8B%AB%EA%B8%B0%5D.png)
예를 들어 12시 48분과 16시 29분 등 두 번의 시간이 있습니다. 12시 48분부터 16시 29분까지 로그인한 사용자를 어떻게 나열하나요?
답변1
및 또는 플래그와 함께 명령을 사용하십시오 last
.-s
-t
-p
-s, --since <time> display the lines since the specified time
-t, --until <time> display the lines until the specified time
-p, --present <time> display who were present at the specified time
last -s "12:48" -t "16:29"
last -p "12:48"
첫 번째 명령은 현재 로그인을 표시하지 않습니다.
TIME FORMATS
The options that take the time argument understand the following formats:
YYYYMMDDhhmmss
YYYY-MM-DD hh:mm:ss
YYYY-MM-DD hh:mm (seconds will be set to 00)
YYYY-MM-DD (time will be set to 00:00:00)
hh:mm:ss (date will be set to today)
hh:mm (date will be set to today, seconds to 00)
now
yesterday (time is set to 00:00:00)
today (time is set to 00:00:00)
tomorrow (time is set to 00:00:00)
+5min
-5days