← Learn
Dangerous
rm -rf /var/lib/postgresql/16/main

linux · bash · Beginner

Recursively deletes the PostgreSQL data directory for a major version. The cluster's tables, indexes, and write-ahead log all live under this path, so the databases go with it and reinstalling the package will not bring them back.

Signals to notice

  • rm -rf against the directory holding live database files
  • the data directory is not recreated by reinstalling the package

Think you can spot these under time pressure?

Start Training

More File System