1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

grep /find help please!

Discussion in 'LOS Archive' started by barkingboy, 18 Nov 2002.

  1. barkingboy

    Hitman

    Joined: 18 Oct 2002

    Posts: 931

    Location: Berkshire

    Hi,

    Can any clever soul please tell me how to use the find and grep commands to look through a folder, say "/web" and find all the files that contain "hello" in them please! :cool:

    Oh yeah it needs to recurse through the sub folders too.

    Thanks!
     
  2. barkingboy

    Hitman

    Joined: 18 Oct 2002

    Posts: 931

    Location: Berkshire

    lol I found one right after that post! :rolleyes: :D

    find /webs/ -exec grep -l "hello" {} \; 2> /dev/null

    Very useful command. cheers.