If -prune
doesn’t work for you, this will:
find -name "*.js" -not -path "./directory/*"
Caveat: requires traversing all of the unwanted directories.
More Related Contents:
- How to exclude a directory in find . command
- ‘find -exec’ a shell function in Linux
- How to only get file name with Linux ‘find’?
- How do I prompt for Yes/No/Cancel input in a Linux shell script?
- How can I search for a multiline pattern in a file?
- Environment variable substitution in sed
- ./configure : /bin/sh^M : bad interpreter [duplicate]
- What does “&” at the end of a linux command mean?
- The ‘eval’ command in Bash and its typical uses
- How to join multiple lines of file names into one with custom delimiter?
- Is there a way to ‘uniq’ by column?
- Linux: copy and create destination dir if it does not exist
- Get most recent file in a directory on Linux
- Get program execution time in the shell
- Edit shell script while it’s running
- Linux bash: Multiple variable assignment
- How to sort a file in-place?
- How to substitute shell variables in complex text files
- Is it OK to use the same input file as output of a piped command?
- Find files and tar them (with spaces)
- When to wrap quotes around a shell variable?
- How to get file creation date/time in Bash/Debian?
- How to join multiple lines of filenames into one with custom delimiter
- What is the difference between “./somescript.sh” and “. ./somescript.sh”
- Linux removing folders older than 1 year and more than 3 files
- How to set process group of a shell script
- Write a bash shell script that consumes a constant amount of RAM for a user defined time [closed]
- How to create a dynamic variable and assign value to it?
- awk – how to delete first column with field separator
- How to create a link to a directory on linux [closed]