如何仅获取 WordPress 中活动插件的名称?
我正在尝试获取活动 WordPress 插件的列表,为此我正在使用 wp plugin list --status=active --allow-root 命令。
这给了我这样的挫败感。
+----------------+--------+--------+---------+
| name | status | update | version |
+----------------+--------+--------+---------+
| akismet | active | none | 4.2.2 |
| classic-editor | active | none | 1.6.2 |
| contact-form-7 | active | none | 5.5.6 |
| wordfence | active | none | 7.5.9 |
| wpforms-lite | active | none | 1.7.3 |
+----------------+--------+--------+---------+
不知道如何删除额外的表并仅获取插件的名称,例如
akismet
classic-editor
contact-form-7
wordfence
wpforms-lite
对此问题的任何帮助将不胜感激
I am trying to to get list of active Wordpress plugins and for that I am using wp plugin list --status=active --allow-root command.
That gives me putout like this.
+----------------+--------+--------+---------+
| name | status | update | version |
+----------------+--------+--------+---------+
| akismet | active | none | 4.2.2 |
| classic-editor | active | none | 1.6.2 |
| contact-form-7 | active | none | 5.5.6 |
| wordfence | active | none | 7.5.9 |
| wpforms-lite | active | none | 1.7.3 |
+----------------+--------+--------+---------+
Not sure how do I remove extra tables and get only names of the plugin such as
akismet
classic-editor
contact-form-7
wordfence
wpforms-lite
any help in this matter would be appreciated
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
得到结果
我设法使用 awk 和 grep
wp plugin list --status=active --allow-root > 猫列表.txt | 列表.txt awk '{print $1}' | grep -v -e "名称" >插件.txt
I managed to get the result using awk and grep
wp plugin list --status=active --allow-root > list.txt cat list.txt | awk '{print $1}' | grep -v -e "name" > plugin.txt