The standard option grep -l
(that is a lowercase L) could do this.
From the Unix standard:
-l (The letter ell.) Write only the names of files containing selected lines to standard output. Pathnames are written once per file searched. If the standard input is searched, a pathname of (standard input) will be written, in the POSIX locale. In other locales, standard input may be replaced by something more appropriate in those locales.
You also do not need -H
in this case.
Related Posts:
- How do I grep recursively?
- How do I grep recursively?
- How do I find all files containing specific text on Linux?
- How do I grep recursively?
- How to perform grep operation on all files in a directory?
- How do I use grep to search the current directory for all files having the a string “hello” yet display only .h and .cc files?
- How can I exclude directories from grep -R?
- How can I exclude directories from grep -R?
- Diff command along with Grep gives “Binary file (standard input) matches”
- How to get the process ID to kill a nohup process?
- How to grep and replace
- Confused about stdin, stdout and stderr?
- How to set the environmental variable LD_LIBRARY_PATH in linux
- What’s a .sh file?
- How to fix ‘sudo: no tty present and no askpass program specified’ error?
- What does pss mean in /proc/pid/smaps
- apt-get error: Sub-process /usr/bin/dpkg returned an error code (1)
- how to find libstdc++.so.6: that contain GLIBCXX_3.4.19 for RHEL 6?
- How to extract C source code from .so file?
- subprocess.Popen(): OSError: [Errno 8] Exec format error in python?
- How to substitute shell variables in complex text files
- How can I recursively find all files in current and subfolders based on wildcard matching?
- Curl command for https ( SSL )
- “sed” command in bash
- How to exclude a directory in find . command
- How can I find all *.js file in directory recursively in Linux?
- Argument list too long error for rm, cp, mv commands
- Difference between using “chmod a+x” and “chmod 755”
- ssh: Could not resolve hostname [hostname]: nodename nor servname provided, or not known
- WSL – GEDIT Unable to init server: Could not connect: Connection refused
- Python subprocess.Popen “OSError: [Errno 12] Cannot allocate memory”
- Install tkinter for Python
- How to open some ports on Ubuntu?
- Given two directory trees, how can I find out which files differ by content?
- What does it mean to mount a file system in linux?
- curl: (6) Could not resolve host: google.com; Name or service not known
- How to pass password to scp?
- scp gives “not a regular file”
- -bash: fork: Cannot allocate memory
- Explanation of polkitd Unregistered Authentication Agent
- CentOS error – sudo: effective uid is not 0, is sudo installed setuid root?
- Merge / convert multiple PDF files into one PDF
- scp from Linux to Windows
- Bash script: bad interpreter
- How do I find the MySQL my.cnf location
- PHP and mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
- node.js: cannot find module ‘request’
- What does “&” at the end of a linux command mean?
- wget returns “Unable to establish SSL connection”
- How to recursively download a folder via FTP on Linux
- Apache server keeps crashing, “caught SIGTERM, shutting down”
- Using grep and ls -a commands
- List all mounts in Linux
- How to use sed to extract substring
- error : storage class specified for parameter
- Wait for user input in C?
- How do I write stderr to a file while using “tee” with a pipe?
- tar: Error is not recoverable: exiting now
- python-dev installation error: ImportError: No module named apt_pkg
- WordPress Update – This is usually due to inconsistent file permissions.: wp-admin/includes/update-core.php
- WordPress sites being filled with random PHP files
- how to properly mount external server directory for wordpress uploads
- Is it a good idea to edit WordPress within Eclipse? [closed]
- Why is my crontab not working, and how can I troubleshoot it?
- Why is “chmod -R 777 /” destructive?
- How to check if a library is installed?
- Is it normal to get hundreds of break-in attempts per day?
- How do I prevent accidental rm -rf /*?
- How do I verify the speed of my NIC?
- What does Virtual memory size in top mean?
- What’s the best way to check if a volume is mounted in a Bash script?
- How do I find the UUID of a filesystem
- Find out symbolic link target via command line
- Meaning of directories on Unix and Unix like systems
- How to handle security updates within Docker containers?
- Job scheduling using crontab, what will happen when computer is shutdown during that time?
- Is it possible to make Nginx listen to different ports?
- how do you create an ssh key for another user?
- REJECT vs DROP when using iptables
- Linux command line best practices and tips?
- How to run command as user who has /usr/sbin/nologin as Shell?
- How to get pid of just started process
- How to disable everything in crontab -l?
- df says disk is full, but it is not
- Perform rsync while following sym links
- What is the maximum port number?
- Show all users and their groups/vice versa
- Why is TCP accept() performance so bad under Xen?
- Caching/preloading files on Linux into RAM
- How to sort ps output by process start time?
- What’s wrong with always being root?
- Is there a proper way to clear logs?
- Hundreds of failed ssh logins
- Transfer 15TB of tiny files
- What should I do when I got the KEYEXPIRED error message after an apt-get update?
- protocol version mismatch — is your shell clean?
- How do I join two named pipes into single input stream in linux
- How should an IT department choose a standard Linux distribution?
- Command line program to test DHCP service
- Service start request repeated too quickly, refusing to start limit