find . -name foo.yml -exec bash -c "grep -q office {} && echo {} && grep office {}" \;
find . -printf "%T@ %Tc %p\n" | sort -n
printf arguments from man find:
%Tk: File's last modification time in the format specified by k.
@: seconds since Jan. 1, 1970, 00:00 GMT, with fractional part.
c: locale's date and time (Sat Nov 04 12:02:33 EST 1989).
%p: File's name.
find . -perm -o+r
And the opposite :
find . ! -perm -o+r
for root, dirs, files in os.walk("folder"):
for file in files:
if file.endswith(".yml"):
print(os.path.join(root, file))
with open(os.path.join(root, file), "r") as sources:
lines = sources.readlines()
with open(os.path.join(root, file), "w") as sources:
for line in lines:
sources.write(re.sub(r'pattern', 'foo', line))
ack permet de rechercher dans une arbo plus facilement (moins verbeusement) qu'avec grep et find.
Orienté developpeur car il ignore tous les fichiers/dossiers des gestionnaires de versions (svn, git, vcs, mercurial..)