如何在命令行上列出 SQLite3 数据库表

另请参见如何在 Python 中列出 SQLite3 数据库中的表

使用此命令通过 sqlite3 命令行工具列出 SQLite3 数据库中的所有表:

list_sqlite_tables.sh
sqlite3 [database file] "SELECT name FROM sqlite_master WHERE type='table' AND name != 'sqlite_sequence';"

示例:

list_sqlite_tables_example.sh
$ sqlite3 /usr/share/command-not-found/commands.db "SELECT name FROM sqlite_master WHERE type='table' AND name != 'sqlite_sequence';"
commands
packages

Check out similar posts by category: Databases, SQLite