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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • 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. CentOS / RHEL : How to remove used Physical Volume(PV) from Volume Group (VG) in LVM
  2. How to Check if a Service Restart or Server Reboot is required After RPM Package Update (CentOS/RHEL/Fedora)
  3. scriptreplay: command not found
  4. xclip Command Examples in Linux
  5. qemu-system-x86_64: command not found
  6. How to use compress, zip, gzip commands under Linux
  7. rdesktop: command not found
  8. grub-bios-setup: command not found
  9. CentOS / RHEL 5,6 : How to Change the timezone
  10. column: Format standard input or a file into multiple columns

You May Also Like

Primary Sidebar

Recent Posts

  • csslint: A linter for CSS code
  • csh: The shell (command interpreter) with C-like syntax (Command Examples)
  • csc: The Microsoft C# Compiler (Command Examples)
  • crystal: Tool for managing Crystal source code

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright