今日の2つの日付の間にログインしたユーザーを表示[閉じる]

今日の2つの日付の間にログインしたユーザーを表示[閉じる]

たとえば、12時48分と16時29分の2時間です。 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

おすすめ記事