Skip to main content
edited tags
Link
Celada
  • 45.8k
  • 5
  • 100
  • 108
added 5 characters in body
Source Link
Anthon
  • 81.4k
  • 42
  • 174
  • 228

I'm searchinsearching for all files that containscontain one of thosea set of strings. If they do i, I change their access rights.

 find . -type f -exec grep -q '#!/bin/bash\|#!/usr/bin/grep\|#!/usr/bin/awk' {} \; -exec chmod 700 {} ;\

I'm curious how the find works when it finds a file containing that string grep -q gives me 0 so another exec executes but should not that. That second exec findfinds all files and change the rights to all files ?. Why does it workswork and change it only tothose files containing that string.?

I'm searchin for all files that contains one of those strings If they do i change their access rights.

 find . -type f -exec grep -q '#!/bin/bash\|#!/usr/bin/grep\|#!/usr/bin/awk' {} \; -exec chmod 700 {} ;\

I'm curious how the find works when it finds a file containing that string grep -q gives me 0 so another exec executes but should not that second exec find all files and change the rights to all files ? Why does it works and change it only to files containing that string.

I'm searching for all files that contain one of a set of strings. If they do, I change their access rights.

 find . -type f -exec grep -q '#!/bin/bash\|#!/usr/bin/grep\|#!/usr/bin/awk' {} \; -exec chmod 700 {} ;\

I'm curious how the find works when it finds a file containing that string grep -q gives me 0 so another exec executes but should not. That second exec finds all files and change the rights to all files. Why does it work and change only those files containing that string?

I'm searchin for all files that contains one of those strings If they do i change their access rights.

 find . -type f -exec grep -q '#!/bin/bash\|#!/usr/bin/grep\|#!/usr/bin/awk' {} \; -exec chmod 700 {} ;\

I'm curious how the find works when it finds a file containing that string grep -qgrep -q gives me 00 so another exec executes but should not that second execexec find all files and change the rights to all files ? Why does it works and change it only to files containing that string.

I'm searchin for all files that contains one of those strings If they do i change their access rights.

 find . -type f -exec grep -q '#!/bin/bash\|#!/usr/bin/grep\|#!/usr/bin/awk' {} \; -exec chmod 700 {} ;\

I'm curious how the find works when it finds a file containing that string grep -q gives me 0 so another exec executes but should not that second exec find all files and change the rights to all files ? Why does it works and change it only to files containing that string.

I'm searchin for all files that contains one of those strings If they do i change their access rights.

 find . -type f -exec grep -q '#!/bin/bash\|#!/usr/bin/grep\|#!/usr/bin/awk' {} \; -exec chmod 700 {} ;\

I'm curious how the find works when it finds a file containing that string grep -q gives me 0 so another exec executes but should not that second exec find all files and change the rights to all files ? Why does it works and change it only to files containing that string.

Source Link
pnom
  • 297
  • 1
  • 3
  • 8
Loading