Excluding directory from grep

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

A summary of linux user management tools

To add an existing user “frank” to an existing group “ssh”:

usermod -a -G ssh frank

To add new user “mike” to existing group “friends.”
usermod -g friends mike

To show all members in a group “people”:
sudo apt-get install members
members people

A summary of linux user management tools