list all files in directory tree that contain a search string
find . -type f -print | xargs grep -li "find me"If you have a large directory tree and you are sure that a file is in there somewhere, and you know that the phrase "find me" (e.g.) is in what you are looking for, then a command line like the above is just what you need.
The find command filters out all directories and special files and prints a list of them to the pipe. The xargs command takes the piped list and makes it into an argument list for the grep. The -li options on the grep mean ignore case...so "FIND ME" or "find me" is matched, and list once means the output is a list of filenames which only mentions each file once.
Solid state disks (SSDs) made a splash in consumer technology, and now the technology has its eyes on the enterprise storage market. Download this eBook to see what SSDs can do for your infrastructure and review the pros and cons of this potentially game-changing storage technology.
- 1Linux Top 3: GNOME 3.12 and New Betas for Ubuntu 14.04 and OpenMandriva Lx 2014.0
- 2Linux Top 3: Linux 3.10 Goes Long, Linux 3.11 Advances as LXDE Merges
- 3Linux Top 3: Linus Lashes out, Linux 3.14 Gets PIE and Ubuntu One is Done.
- 4Why Linux is Super (Computing)
- 5Linux Top 3: Ubuntu 14.04, Debian Gives Squeeze More Life and Red Hat Goes Atomic