Desde 2009 se adoptó una convención Consistent Network Device Naming
para nombrar Ethernet adapters
en Linux
, por eso tienes eno1
y no eth0
. Y por carecer de una configuración para su NIC principal en /etc/networks/interfaces
-, lo más probable es que tenga network-manager
instalado. Puede ver información al respecto aquí .
Si desea utilizar /etc/network/intefaces
, simplemente deshabilite o elimine Network-Manager
y configure eno1
según sus requisitos en /etc/network/interfaces
.
-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.
Он использует шаблоны оболочки, а не регулярное выражение.
Источник:find(1)
Из руководства GNU под имя:
Here are ways to search for files whose name matches a certain pattern. See Shell Pattern Matching, for a description of the pattern arguments to these tests.
2.1.4 Сопоставление шаблона оболочки
find и locate могут сравнивать имена файлов или части имен файлов с шаблонами оболочки. Шаблон оболочки — это строка, которая может содержать следующие специальные символы, известные как подстановочные знаки или метасимволы.
Шаблоны, содержащие метасимволы, необходимо заключать в кавычки, чтобы интерпретатор не смог расширить их самостоятельно. Двойные и одинарные кавычки работают; то же самое можно сказать и об экранировании с помощью обратной косой черты.
*
?
[string]
\
Символы косой черты не имеют особого значения в сопоставлении шаблонов оболочки, которые выполняют поиск и поиск, в отличие от оболочки,в которых подстановочные знаки не соответствуют им. Следовательно, шаблон «foo bar» может соответствовать имени файла «foo3/bar», а шаблон «./sr sc» может соответствовать имени файла «./src/misc».
Если вы хотите найти некоторые файлы с помощью команды «locate», но вам не нужен полный список, вы можете использовать параметр «--limit», чтобы увидеть только небольшое количество результатов, или «--count», чтобы отображалось только общее количество совпадений.
Чтобы ответить на ваш вопрос:
find. -name "*.sw?" -type f