[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dúvida comando



On Mon, Jan 18, 2010 at 06:27:41PM -0300, Mauricio Rocha wrote:
> Pessoal leva a mal não, mas, alguém pode me explicar por que o uso
> do 'string'?  não sei usar bem o find e fiquei sem sacar!

  /+
   |
   + -dir1 
   |   +-arquivo1.txt
   |   +-arquivo2.txt
   + -dir2
       +-arquivo3.txt     
  
  arquivo1 = 'campanha da fita ascii'
  arquivo2 = 'contra mail html'
  arquivo3 = 'ascii rlzz!'

  $ find / -name '*.txt' -exec grep -l 'ascii' {} \;
  /dir1/arquivo1.txt
  /dir2/arquivo3.txt

  ---

  man find
  man grep
  


> 
> Em 18/1/2010 15:36, Pedro Insua escreveu:
> >On Mon, Jan 18, 2010 at 03:28:21PM -0200, Adriano Rafael Gomes wrote:
> >>Em Mon, 18 Jan 2010 14:16:53 -0300
> >>DIEGO MONTE<diego.smonte@gmail.com>  escreveu:
> >>
> >>>Preciso identificar (listar), no Linux, todos os arquivos, padrão
> >>>texto (*.txt), a partir de um determinado diretório, de forma
> >>>recursiva, ou seja, todos os seus subdiretórios, que contenham uma
> >>>determinada string em seu conteúdo. Temos alguma "saída" para tal
> >>>problema?
> >>Diego, ajuste os valores para 'diretorio' e 'string' abaixo e tente:
> >>
> >>$ find diretorio -name '*.txt' -exec grep 'string' {} \;
> >   De certo o grep debe levar '-l' pra listar os arquivos, nao o conteudo
> >
> >   $ find diretorio -name '*.txt' -exec grep -l 'string' {} \;
> >

  


-- 
Porqué loitar e matar, se podes amar e sonhar

/"\
\ /  CAMPANHA DA FITA ASCII - CONTRA MAIL HTML
 X   ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
/ \


Reply to: