find
is a utility that searches for files and directories matching given criteria. You can have it match on file name, type,
differentiate links vs. real files, filter based on size and so on.
This limits find to only return files and not directories.
Normally, find just returns a giant stream of text with each file separated by a newline. When you dump that text as arguments
to another program (via xargs) those programs can't tell the difference between spaces in the file names and new file names.
the -print 0
option tells find to put a null character between arguments, thus making it easy for xargs
to chunk those into
discreet arguments using its -0
option.
This tells find to only return files matching a specific pattern using shell matching style, case insensitive.
The -o
parameter means or
and allows you to put multiple matchers inside the parenthesis to match multiple
kinds of files, in this case *.js
and *.ts
.
xargs
is a utility that takes a stream of text and passes it as arguments to another program. It is a simple way of taking a
stream of text such as that produced by find
and passing it as command line options to programs to operate on it like grep
It can be configured to specifically format the incoming text, limit it to only one argument at a time or 10 or all of them for each execution of the target program.
Treats the incoming stream as though it will be null delimited instead of dumping it directly to the program.
grep
searches through a stream of text or a file for a given regular expression pattern.
Makes the match case insensitive.