Skip to content

Neanderslob VS Technology

As I stumble through the world of linux, I've decided to log new tricks I learn because I often forget. I decided to share the log because…. eh, why not.

Recent Posts

  • Formatting Numerical Input with Rails
  • Kubuntu 16.04 GUI Audio Controls not working
  • Polymorphic Associations The Smart Way: Using Global Ids
  • Get Firefox to display warning message when exiting multiple tabs
  • Cheatsheet for viewing commits/branches in git

Recent Comments

Jonah's avatarJonah on Adding a devise user or admin…
ashokM's avatarashokM on Formatting Numerical Input wit…
ChuBiggie's avatarChuBiggie on Kubuntu 16.04 GUI Audio Contro…
John's avatarJohn on Notes: To import a csv into a…
jaehoo's avatarjaehoo on Kubuntu 16.04 GUI Audio Contro…

Archives

  • May 2016
  • April 2016
  • November 2015
  • June 2015
  • May 2015
  • February 2015
  • January 2015
  • December 2014
  • June 2014
  • May 2014
  • November 2013
  • October 2013
  • September 2013
  • March 2013
  • September 2012
  • July 2012
  • May 2012
  • April 2012
  • March 2012

Categories

  • databases
  • KDE
  • Linux
  • Media
  • Notes
  • Open/Libre Office
  • Openmeetings
  • reblog
  • ruby on rails
  • Uncategorized
  • Web Development

Meta

  • Create account
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.com

exclude

Excluding directory from grep

February 14, 2015 neanderslobbash, exclude, grep, linux, notes, terminalLeave a comment

For some reason, I can never remember how to do this.

If you ever want to grep for something but leave out a particular directory, use the --exclude-dir=DIR

So if I wanted to search the current directory for the string img, but don’t want to look in the directories tmp or log.

grep -r --exclude-dir=log --exclude-dir=tmp "img" ./

Excluding directory from grep
Create a free website or blog at WordPress.com.
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Subscribe Subscribed
    • Neanderslob VS Technology
    • Already have a WordPress.com account? Log in now.
    • Neanderslob VS Technology
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar