Skip to main content

PowerShell: Equivalent to UNIX find/grep

Product: Windows PowerShell

I was trying to find out the PowerShell command that equivalent to following UNIX command to search through all files for a particular text (or regular expression)

find . | grep -i "family_picture"

The PowerShell equivalent is

Get-ChildItem -recurse | select-string -pattern "family_picture"

Default is not case sensitive, so no need to map "grep -i" parameter. If needed case sensitive, then it will be

Get-ChildItem -recurse | select-string -pattern "family_picture" -casesensitive

Comments

Popular posts from this blog

Zabbix, AWS and Auto Registration

One of the things I love the most with AWS is  auto-scaling . You choose an AMI, set some parameters and AWS will spin instances up and down whenever a threshold is breached. But with all these instances spinning up and down there are some unknowns. For example, what is the IP address of the new instance? Its host name? This can be critical when other components of your infrastructure are dependent on knowing these parameters. I had this problem when I started to use  Zabbix  as the monitoring system. At first it seemed like a complicated one, but Zabbix has a wonderful feature called  Auto Registration  which can be used exactly for this situation. I will try to show how to configure auto registration both on the client (EC2 instance running Ubuntu 14.04) and on the Zabbix server (Zabbix Server 2.4.2). Zabbix-agent Installation and Configuration Let’s start with installing zabbix-agent on the Ubuntu client: 1 2 $ sudo apt-get update $ sud...

Scaling Kubernetes to 2,500 Nodes

We’ve been running  Kubernetes  for deep learning research for over two years. While our largest-scale workloads manage bare cloud VMs directly, Kubernetes provides a fast iteration cycle, reasonable scalability, and a lack of boilerplate which makes it ideal for most of our experiments. We now operate several Kubernetes clusters (some in the cloud and some on physical hardware), the largest of which we’ve pushed to over 2,500 nodes. This cluster runs in Azure on a combination of D15v2 and NC24 VMs. On the path to this scale, many system components caused breakages, including etcd, the Kube masters, Docker image pulls, network, KubeDNS, and even our machines’ ARP caches. We felt it’d be helpful to share the specific issues we ran into, and how we solved them. etcd After passing 500 nodes in our cluster, our researchers started reporting regular timeouts from the  kubectl  command line tool. We tried adding more Kube masters (VMs running  kube-apiserv...

CTI with Node + Redis

Summary In this article I'll be discussing a way to implement call data passing between disparate telephony systems, i.e., Computer Telephony Integration (CTI).  The techniques I employ in this article ( DNIS pooling, database storage of call data, etc) are nothing groundbreaking.  In fact, these techniques are as old as the hills (well, maybe not that old).  What will be new here is the use of current software architectures such as REST  with highly-efficient run-time environments such as Node.js and Redis  to realize an open data integration between 3rd party systems. This article is the culmination of a series I've written on this topic.  In Part 1,  REST calls from Genesys Routing Strategies , I discussed how to make REST web service calls from one particular vendor's CTI system ( Genesys ).  In Part 2, VXML and REST Web Services , I discussed REST web service execution from VXML applications. I'll be leveraging informa...