Skip to main content

Posts

Showing posts from June, 2016

How to find files that match some pattern with the grep command in Linux?

In Linux, if you know that a particular directory has a very large number of files (say close to 30,000) and you need to find a file in it, typing the ls  command in the command prompt will actually not help you. This is because it will take some amount of time (few minutes may be) to load them in. Instead, if you know at least some part of the name of the file, you can type the following command and print it out in the command prompt.   For example, the following command finds the file containing ' galvan ' as full or part of its name in the directory given by /data . find /data - type f - print | grep 'galvan'