Рекурсивно заменить путь в файлах в каталоге, кроме бинарные файлы

Hay muchas causas posibles de una regresión como esta, pero algunos contendientes probables serían el firmware del dispositivo o un controlador del kernel que no puede apagar un dispositivo al apagarlo. Si un kernel más nuevo no solucionó su problema, entonces la mejor manera de encontrar al culpable es hacer un git bisectentre las dos versiones de kernel que funcionan y las que no funcionan -conocidas más cercanas para averiguar exactamente qué cambio causó la regresión.

Para obtener algunas guías sobre esto, intente poner git bisect linux kernelen su motor de búsqueda favorito.

Para verificar rápidamente el consumo de energía, puede usar un enchufe -en el medidor de energía y verificar el consumo de energía del dispositivo con la batería extraída (si su computadora portátil lo permite )o alternativamente con la batería completamente cargado.

0
16.06.2019, 01:20
2 ответа

find. -type f -name "*.depend" -exec sed -i 's/foo/bar/g' {} +

или

find. -type f -not -name "*.c" -not -name "*.o" -exec sed -i 's/foo/bar/g' {} +

       -name pattern
              Base of file name (the path with the leading directories
              removed) matches shell pattern pattern.  Because the leading
              directories are removed, the file names considered for a match
              with -name will never include a slash, so `-name a/b' will
              never match anything (you probably need to use -path instead).
              A warning is issued if you try to do this, unless the
              environment variable POSIXLY_CORRECT is set.  The
              metacharacters (`*', `?', and `[]') match a `.' at the start
              of the base name (this is a change in findutils-4.2.2; see
              section STANDARDS CONFORMANCE below).  To ignore a directory
              and the files under it, use -prune; see an example in the
              description of -path.  Braces are not recognised as being
              special, despite the fact that some shells including Bash
              imbue braces with a special meaning in shell patterns.  The
              filename matching is performed with the use of the fnmatch(3)
              library function.  Don't forget to enclose the pattern in
              quotes in order to protect it from expansion by the shell.

http://man7.org/linux/man-pages/man1/find.1.html

5
28.01.2020, 02:15

Я написал этот код, он работает для моей цели:

find. -type f -exec grep -Iq. {} \; -exec sed -i 's|/foo|/bar|g' {} +
0
28.01.2020, 02:15

Теги

Похожие вопросы