Grep - Tips to use in linux

Hi all,

As we all know grep is used as a utility to search for a string in files.
Some usage of grep which is useful in day-to-day work.

Search in specific file extensions. Example : - Grep in only .c, .h files

grep -rl --include=\*.{c,h} <search_string> <path to search>
The above command search for the search_string in path to search in only .c and .h files.


How to find the folders larger than 1 GB in the present working directory?

      du -h --max-depth=1 . | grep '[0-9]G\>'

Comments

Popular posts from this blog

SOX - Sound eXchange - How to use SOX for audio processing tasks in research.

How to get video or audio duration of a file using ffmpeg?

Sox of Silence - Original post - http://digitalcardboard.com/blog/2009/08/25/the-sox-of-silence/