How to find expired user accounts in Linux

  • Pingback: Linux Shadow file explained in detail | The Linux Juggernaut()

  • meow

    This would be much shorter if using awk:
    “`sh
    awk ‘BEGIN{FS=”:”;printf(“%-24s%sn”,”USER”,”DAYS_LEFT”)}$8!~/^$/{printf(“%-24s%dn”, $1,($8*86400-strftime(“%s”))/86400)}’ /etc/shadow
    “`

    • http://www.linuxnix.com Surendra Anne

      Thanks for sharing your knowledge Meow. Time gives you the experience. Keep visiting linuxnix.com

banner