• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

pwck Command Examples in Linux

by admin

The pwck command checks the integrity of /etc/passwd and /etc/shadow, and grpck checks /etc/group and /etc/gshadow. They look for correct format, valid data, valid names, and valid GIDs (see the man pages for a complete list). When you run these with no options, they report both warnings and errors:

$ pwck
user 'news': directory '/var/spool/news' does not exist
user 'uucp': directory '/var/spool/uucp' does not exist
user 'www-data': directory '/var/www' does not exist
user 'list': directory '/var/list' does not exist

Add the -q option to report only errors:

$ pwck -q

pwck Command Examples in Linux

1. To verify integrity of password files:

# pwck 

2. To report errors only:

# pwck -q 

3. To execute the pwck command in read only mode:

# pwck -r

4. To sort entries in passwd and shadow file:

# pwck -s 

5. To get the help for pwck:

# pwck --help

Filed Under: Linux

Some more articles you might also be interested in …

  1. csplit: command not found
  2. Understanding OpenSSH Configuration Files
  3. qm wait Command Examples in Linux
  4. mcs Command Examples
  5. pw-cli Command Examples in Linux
  6. CentOS / RHEL : How to install a specific version of rpm package using YUM
  7. file Command Examples in Linux
  8. rpmspec Command Examples in Linux
  9. lrunzip Command Examples in Linux
  10. How to Install librw-dev software package in Ubuntu

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright