If you have comments or thoughts about my blog, you can contact me at my lab here:
Recursive search for files with specific content using GREP
So you know that somewhere in your source folder (/source) that there is a script that uses the foo() function but you cant remember which one and there are thousands of files, what do you do?
You grep them!
grep -R -i -n 'foo()' *
Lets break it down, first we are grepping files, the -R indicates to search recursively, -i indicates we want to ignore case, and -n indicates we want to know which line of the file grep finds our search string on. then the search string in single quotes and lastly, a finame wildcard, in this case, search through every file.
Recent blog posts
- Easy exporting of Drupal 7 custom fields for use in module code.
- Midnight Commander on OS-X
- Get lists of NIDs from DB filtering by fields without having to do joins - Hello "Entity Field Query"
- Setting the maximum upload size or php memory for Drupal 7
- Charts and Graphs in Drupal 7
- Restore a LVM image to LVM direct from gzip to LVM with a progress bar
- Check if port XXX is listening on your server
- Fix slow SSH response on your Ubuntu Server
- Things i like to do to Ubuntu to make it rock.
- Find and eliminate rogue or ghost KVM Virtual machines under Cloudmin