You can’t ignore initial search in all directories, but you can remove the files from specified directory after the first step.
find . -type f -exec grep -l "port" {} \;| grep -v <dir_name_to exclude>
More Related Contents:
- What do you think about the new Debian release cycle?
- How do I recursively grep all directories and subdirectories?
- Save modifications in place with awk
- Why should eval be avoided in Bash, and what should I use instead?
- Where can I set environment variables that crontab will use?
- How to kill a child process after a given timeout in Bash?
- What is the meaning of “POSIX”?
- Better way to rename files based on multiple patterns
- Delete empty lines using sed
- Linux: copy and create destination dir if it does not exist
- What is the difference between “#!/usr/bin/env bash” and “#!/usr/bin/bash”?
- Extract file basename without path and extension in bash [duplicate]
- How do you find the original user through multiple sudo and su commands?
- How can I remove the last character of a file in unix?
- How do I escape spaces in path for scp copy in Linux?
- How to check if a file is empty in Bash?
- Finding contents of one file in another file
- Difference between Real User ID, Effective User ID and Saved User ID
- Should PATH contain directories or full paths to binaries?
- Execute a command without keeping it in history [closed]
- How do I set up cron to run a file just once at a specific time? [closed]
- How can I pipe initial input into process which will then be interactive?
- How do I get the path of a process in Unix / Linux?
- How to convert \uXXXX unicode to UTF-8 using console tools in *nix
- Running shell script in parallel
- Difference between shell and environment variables
- Why crontab uses OR when both day of month and day of week specified?
- Syntax error near unexpected token ‘then’
- Why doesn’t “sort file1 > file1” work?
- How pthread_mutex_lock is implemented