# 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 perl -pi -w -e 's/thex/robertsonlibrary/g;' **/*.* ## search replace in file names rename 's/livero/lives/g' **/*.* -v ## torrent download aria2c -d ~/Downloads "magnetlink" ocrmypdf --optimize 3 --skip-text input.pdf output.pdf ocrmypdf --optimize 3 --image-dpi 300 --output-type pdf \ --force-ocr --tesseract-pagesegmode 1 input.pdf output.pdf # down sample pdfs to 72dpi (single file) gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 \ -dPDFSETTINGS=/screen \ -dNOPAUSE -dQUIET -dBATCH \ -sOutputFile=output.pdf input.pdf (batch) for f in *.PDF; do gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 \ -dNOPAUSE -dBATCH \ -dDownsampleColorImages=true -dColorImageResolution=72 \ -dDownsampleGrayImages=true -dGrayImageResolution=72 \ -dDownsampleMonoImages=true -dMonoImageResolution=72 \ -sOutputFile="output_pdfs/$f" "$f" done