Skip to main content
deleted 3 characters in body
Source Link
muru
  • 73.9k
  • 14
  • 204
  • 303

Depending on the way you want to handle directories contents,

  • " grep -d recurse "grep -d recurse will do it (handling recursively directories), or
  • "grep -d skip "grep -d skip (ignoring directories and their content).

You could have this be automatic, by adding it to ~/.profile or ~/.bashrc (one user) or /etc/profile or /etc/bashrc (all users)

  • alias grep="/bin/grep -d skip"
alias grep="/bin/grep -d skip" 

Depending on the way you want to handle directories contents,

  • " grep -d recurse " will do it (handling recursively directories), or
  • "grep -d skip " (ignoring directories and their content).

You could have this be automatic, by adding it to ~/.profile or ~/.bashrc (one user) or /etc/profile or /etc/bashrc (all users)

  • alias grep="/bin/grep -d skip"

Depending on the way you want to handle directories contents,

  • grep -d recurse will do it (handling recursively directories), or
  • grep -d skip (ignoring directories and their content).

You could have this be automatic, by adding it to ~/.profile or ~/.bashrc (one user) or /etc/profile or /etc/bashrc (all users)

alias grep="/bin/grep -d skip" 
I added a bit about using an alias to make the idea permanent.
Source Link

Depending on the way you want to handle directories contents,

  • " grep -d recurse " will do it (handling recursively directories), or
  • "grep -d skip " (ignoring directories and their content).

You could have this be automatic, by adding it to ~/.profile or ~/.bashrc (one user) or /etc/profile or /etc/bashrc (all users)

  • alias grep="/bin/grep -d skip"

Depending on the way you want to handle directories contents,

  • " grep -d recurse " will do it (handling recursively directories), or
  • "grep -d skip " (ignoring directories and their content).

Depending on the way you want to handle directories contents,

  • " grep -d recurse " will do it (handling recursively directories), or
  • "grep -d skip " (ignoring directories and their content).

You could have this be automatic, by adding it to ~/.profile or ~/.bashrc (one user) or /etc/profile or /etc/bashrc (all users)

  • alias grep="/bin/grep -d skip"
Source Link
tonioc
  • 2.1k
  • 14
  • 12

Depending on the way you want to handle directories contents,

  • " grep -d recurse " will do it (handling recursively directories), or
  • "grep -d skip " (ignoring directories and their content).