findstr_a_grep_alternative_for_windows
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| findstr_a_grep_alternative_for_windows [2025/03/24 10:44] – created walkeradmin | findstr_a_grep_alternative_for_windows [2025/03/24 10:58] (current) – walkeradmin | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | findstr a grep alternative for Windows | + | ====== |
| + | <color # | ||
| + | \\ | ||
| + | \\ | ||
| + | |||
| + | ---- | ||
| + | ===== Introduction ===== | ||
| + | In Linux, you can filter the return from a command using grep, so if you typed in something that produces pages of responses, like lspci, you can then search using grep. | ||
| + | \\ | ||
| + | \\ | ||
| + | For example. In linux, using Kubernetes I can issue the following command: | ||
| + | \\ | ||
| + | kubectl -n mediakind get pods | ||
| + | |||
| + | The response will be: | ||
| + | \\ | ||
| + | < | ||
| + | NAME | ||
| + | encoding-live-ui-connector-7fd56f5f49-nm8xw | ||
| + | internal-pois-resiliency-54b7457b4b-mk8qh | ||
| + | automation-proxy-primary-d59bd7d59-p2x4r | ||
| + | stream-processor-simulcrypt-779bd9c84d-qjghj | ||
| + | stream-processor-statmux-668475d9d8-n2b24 | ||
| + | encoding-live-config-d8d46bcc-s4pzf | ||
| + | stream-processor-mux-68985b79cf-b8m8r | ||
| + | mongo-operator-5876548666-2nx6v | ||
| + | command-77d97549b6-gl5wv | ||
| + | statistic-7f86d854dc-jx4c9 | ||
| + | kps-agent-operator-7ffc49bb56-bccz8 | ||
| + | stream-processor-asi-7d8b68d7b7-xbh92 | ||
| + | controller-metrics-exporter-55445c799b-cfhr7 | ||
| + | srt-worker-launcher-dcf66587-vg288 | ||
| + | ipmi-exporter-5b9bbcf8bd-r7868 | ||
| + | aquila-crpm-tools-5d9cf76b-28g5h | ||
| + | automation-proxy-secondary-768fd9bc48-ldf9j | ||
| + | stream-processor-ui-connector-847c9dcf6b-4js4p | ||
| + | stream-processor-biss-ca-5b65ff775b-wd5g2 | ||
| + | live-sources-config-6f484978bb-9t66m | ||
| + | alarm-legacy-56785c8649-7592l | ||
| + | kps-prometheus-node-exporter-msvzd | ||
| + | fluent-bit-6f974c7f5b-mk9k2 | ||
| + | api-gateway-559fc7bd7d-nlxbn | ||
| + | encoding-live-worker-54cccbb-tbptk | ||
| + | alertmanager-kps-alertmanager-0 | ||
| + | alarm-5d8898c89c-khzs8 | ||
| + | template-api-7486b595d8-cn55x | ||
| + | server-monitor-66869c694-c2wwj | ||
| + | server-daemon-6bffcf8df5-282kc | ||
| + | etcd-controller1-0 | ||
| + | mongodb-replicaset-controller1-0 | ||
| + | redis-67b9f55655-645zm | ||
| + | metrics-grafana-5ff6669d44-2gwlr | ||
| + | prom-agent-kps-agent-prometheus-0 | ||
| + | kps-kube-state-metrics-55497f5b9f-4dwqp | ||
| + | stream-processor-content-extraction-5ffc9cc565-s7hlw | ||
| + | server-api-7795b4f985-bm8d8 | ||
| + | packaging-vod-ui-connector-5df89f46bb-pdv7m | ||
| + | packaging-cleanup-agent-6d74fcf646-dmscp | ||
| + | packaging-recorder-ui-connector-5668f86b-q5gd9 | ||
| + | packaging-dvr-auto-669bd74d86-wzvsp | ||
| + | support-package-55f7645d79-q4gpq | ||
| + | packaging-asset-recorder-94884c846-ncmjx | ||
| + | rabbitmq-ha-controller1-0 | ||
| + | alarm-adapter-85bc8bcd66-xpc9b | ||
| + | prometheus-kps-prometheus-0 | ||
| + | snmp-notification-96948bc45-gdlkm | ||
| + | packaging-dynamic-ui-connector-b64986898-c9jn6 | ||
| + | unified-ui-c7554fb59-xc8g9 | ||
| + | packaging-config-d644cf946-gwf6h | ||
| + | srt-config-5784dd8f46-2twbd | ||
| + | alarm-proxy-54fdfbcf6b-28r28 | ||
| + | stream-processor-config-766fdb8c96-nb2nl | ||
| + | esam-proxy-56d6d4689d-9gp5j | ||
| + | service-api-dbc74c6fc-s9wln | ||
| + | flow-5797b66959-82qms | ||
| + | interface-discovery-99d6bcff9-2gsgl | ||
| + | srt-ui-connector-6f6bdbd4c9-f2qtd | ||
| + | packaging-dvr-recorder-7b65cf774b-tx972 | ||
| + | failover-api-745685c8d7-5872v | ||
| + | packaging-origin-server-64b75c54ff-pd4wh | ||
| + | license-manager-0 | ||
| + | </ | ||
| + | |||
| + | However, If I was only interested in say ' | ||
| + | \\ | ||
| + | kubectl -n mediakind get pods |grep srt | ||
| + | |||
| + | This would return just any lines that contain ' | ||
| + | \\ | ||
| + | < | ||
| + | srt-worker-launcher-dcf66587-vg288 | ||
| + | srt-config-5784dd8f46-2twbd | ||
| + | srt-ui-connector-6f6bdbd4c9-f2qtd | ||
| + | </ | ||
| + | |||
| + | So grep is a fantastic tool for this, however, grep is not in Windows. | ||
| + | \\ | ||
| + | \\ | ||
| + | ---- | ||
| + | ==== findstr ==== | ||
| + | |||
| + | What is in Windows (and I am using Windows 11-21H2, which is quite old) is something called ' | ||
| + | \\ | ||
| + | kubectl -n medikind get pods | findstr srt | ||
| + | |||
| + | < | ||
| + | srt-fe7a53f67-srt-worker-launcher-54796fb846-r8mpz | ||
| + | srt-mux-vvltle-main-egress-srt-mux-vvltle-main-6756b5b7d-z52ng | ||
| + | srt-mux-vvltle-main-srt-worker-launcher-68bfccb69c-94vsq | ||
| + | </ | ||
| + | |||
| + | So findstr works very well in this use case. | ||
| + | \\ | ||
| + | \\ | ||
| + | ---- | ||
findstr_a_grep_alternative_for_windows.1742813068.txt.gz · Last modified: by walkeradmin
