egrep -lir --include=*.txt "text inside file" .
-i
ignore case-r
recursive--color
highlight match (this colors a bit too much because we also have the line length limiting)"^.{0,200}swagger.{0,200}$"
find all code lines which have wordswagger
in them, so that it must be in the limits of a "normal" code line length. If you write longer lines then 200, increase the number.
egrep -ir --color --exclude-dir={node_modules,build} --include=*.js "^.{0,200}swagger.{0,200}$" .
Improvement idea, additional grep to fix the coloring issue
egrep -ir --exclude-dir={node_modules,build} --include=*.js "^.{0,200}swagger.{0,200}$" . | grep --color "swagger"
tar -tvf file.tar
tar -tzvf file.tar.gz
sudo apt-get install slurm
slurm -i eth0
# Bench mark with HTTP basic auth, custom header, 10 concurrent connections, 1000 times. Use IP instead of localhost
ab -r -v 4 -A user:pass -H "X-Header: test" -c 10 -n 1000 http://127.0.0.1:3000/status/
find . -name '*.js' ! -type d -exec bash -c 'expand -t 4 "$0" > /tmp/e && mv /tmp/e "$0"' {} \;
find . -name "node_modules" -type d -prune -exec rm -rf '{}' +
find src -name '*.js' -exec wc -l {} +
#!/bin/bash
while true; do
ssh "$@"
sleep 1
done
# On OSX: brew install gawk
gawk '(match($0, /service=(.*)ms/, arr)) { if (arr[1] > 1000 ) { print $0 } }' <LOGFILE>
$0
means the full linearr[1]
is the matched regex group
Assuming the XML api returns <TagX>something</TagX>
, the command would output something
.
curl "https://xmlapi.service.com" | sed -n 's:.*<TagX>\(.*\)</TagX>.*:\1:p')
# or
echo '<xml><TagX> something</TagX></xml>' | sed -n 's:.*<TagX>\(.*\)</TagX>.*:\1:p'