find . -name foo.yml -exec bash -c "grep -q office {} && echo {} && grep office {}" \;
-
https://links.infomee.fr/?c7kuZwfind . -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.
-
https://superuser.com/questions/294161/unix-linux-find-and-sort-by-date-modifiedfind . -perm -o+r
And the opposite :
find . ! -perm -o+r
-
https://links.infomee.fr/?fmn6vwfor 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))
-
https://links.infomee.fr/?Y803hgack 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..)
-
http://fr.nicosphere.net/ack-une-alternative-a-grep-pour-codeurs-2380/