The above commands may produce an unnecessary output. List only files names containing a specific text Use grep’s -w option to show only a specific word: Meaning the lines with stretches, stretched etc. The above grep command example lists all files containing string stretch. Search for all files containing a specific word etc/os-release:PRETTY_NAME="Debian GNU/Linux 9 (stretch)" etc/grub.d/00_header:background_image -m stretch `make_system_path_relative_to_its_root "$GRUB_BACKGROUND"` etc/dictionaries-common/words:stretching etc/dictionaries-common/words:stretchiest etc/dictionaries-common/words:stretchier etc/dictionaries-common/words:stretchers etc/dictionaries-common/words:stretcher's etc/dictionaries-common/words:outstretching etc/dictionaries-common/words:outstretches etc/dictionaries-common/words:outstretched etc/dictionaries-common/words:outstretch etc/dictionaries-common/words:homestretches etc/dictionaries-common/words:homestretch's etc/dictionaries-common/words:homestretch etc/dictionaries-common/words:backstretches etc/dictionaries-common/words:backstretch's etc/dictionaries-common/words:backstretch etc/apt/sources.list:deb-src stretch/updates main etc/apt/sources.list:deb stretch/updates main etc/apt/sources.list:deb-src stretch main etc/apt/sources.list:#deb cdrom:/ stretch main etc/apt/sources.list:# deb cdrom:/ stretch main The following linux command will search for a string stretch in all files within /etc/ directory including all sub-directories: To search recursively means to also traverse all sub-directories. The above command omitted all sub-directories. Find all files with a specific string recursively
0 Comments
Leave a Reply. |