usermod -e 的疑問 - Linux

By Caitlin
at 2009-06-19T05:40
at 2009-06-19T05:40
Table of Contents
※ 引述《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
--
: [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
--
Tags:
Linux
All Comments
Related Posts
usermod -e 的疑問

By Aaliyah
at 2009-06-19T02:30
at 2009-06-19T02:30
bash 字串擷取

By Bethany
at 2009-06-19T01:38
at 2009-06-19T01:38
apache + tomcat web server的問題

By Frederica
at 2009-06-18T22:28
at 2009-06-18T22:28
sendmail

By John
at 2009-06-18T22:10
at 2009-06-18T22:10
bash 字串擷取

By Brianna
at 2009-06-18T18:17
at 2009-06-18T18:17