Re: [問題] usermod -e 的疑問
※ 引述《skyheart0822 (賭性堅強)》之銘言:
: [root@localhost ~]# usermod -e 06/30/09 mary
: [root@localhost ~]# grep mary /etc/shadow
: mary:!!:14257:0:99999:7::14425:
: 輸入06/30/09
: 為什麼會出現 14425
: 這是怎麼計算出來的
: 該怎麼從 14425 推出來是 06/30/09
: 謝謝
因為這個數字的計算是從 1970/01/01 開始算的,
例如 2009/06/19 就是 14414 這樣。
可以這樣算出:
$echo $(($(date --date="2009/06/30" +%s)/86400+1))
就是 14425
至於要查詢 /etc/shadow 裡面一些日期資訊的話可以用 chage 這個指令!
$chage -l mary
其他參數請參考手冊!
Reference:
http://linux.vbird.org/linux_basic/0410accountmanager.php#shadow_file
http://linux.vbird.org/linux_basic/0410accountmanager.php#chage
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 192.83.194.62
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):