From b27d3a6620bd92aef34a8b2560efff744d15a2d2 Mon Sep 17 00:00:00 2001 From: rdrew Date: Tue, 11 Oct 2022 13:38:43 -0300 Subject: [PATCH] [nb] Add: cli_commands.md --- .index | 1 + cli_commands.md | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 cli_commands.md diff --git a/.index b/.index index bf82c5e..530d89a 100644 --- a/.index +++ b/.index @@ -3,3 +3,4 @@ lando_drupal_install.md clone_d9_site_for_local_dev.md github_token.md vim_commands.md +cli_commands.md diff --git a/cli_commands.md b/cli_commands.md new file mode 100644 index 0000000..411bf83 --- /dev/null +++ b/cli_commands.md @@ -0,0 +1,12 @@ +# cli commands +#cli + +## display list of content types and # of associated nodes: +drush sqlq 'select count(node.nid) as node_count, node_type.type from node inner join node_type on node.type = node_type.type group by node_type.type' + +## And then if you want filter by a specific type, just use grep like this: +drush sqlq 'select count(node.nid) as node_count, node_type.type from node inner join node_type on node.type = node_type.type group by node_type.type' | grep 2014 + +## search replace in text mulitle files +perl -pi -w -e 's/SEARCH_FOR/REPLACE_WITH/g;' *.txt +