File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ variety of languages and technologies. These are things that don't really
77warrant a full blog post. These are mostly things I learn by pairing with
88smart people at [ Hashrocket] ( http://hashrocket.com/ ) .
99
10- _ 414 TILs and counting..._
10+ _ 415 TILs and counting..._
1111
1212---
1313
@@ -365,6 +365,7 @@ _414 TILs and counting..._
365365- [ Create A File Descriptor with Process Substitution] ( unix/create-a-file-descriptor-with-process-substitution.md )
366366- [ Curling With Basic Auth Credentials] ( unix/curling-with-basic-auth-credentials.md )
367367- [ Do Not Overwrite Existing Files] ( unix/do-not-overwrite-existing-files.md )
368+ - [ Exclude A Directory With Find] ( unix/exclude-a-directory-with-find.md )
368369- [ File Type Info With File] ( unix/file-type-info-with-file.md )
369370- [ Find Newer Files] ( unix/find-newer-files.md )
370371- [ Get The Unix Timestamp] ( unix/get-the-unix-timestamp.md )
Original file line number Diff line number Diff line change 1+ # Exclude A Directory With Find
2+
3+ Using ` find ` is a handy way to track down files that meet certain criteria.
4+ However, if there are directories full of irrelevant files, you may end up
5+ with a lot of noise. What you want to do is exclude or ignore such
6+ directories. For example, you probably don't want ` find ` to return results
7+ from the ` .git ` directory of your project.
8+
9+ Specific directories can be excluded by combining the ` -not ` and ` -path `
10+ arguments.
11+
12+ For instance, to see all files modified within the last 10 days, but not
13+ including anything in the ` .git ` directory, run the following:
14+
15+ ``` bash
16+ $ find . -type f -not -path ' ./.git/*' -ctime -10
17+ ```
18+
19+ [ source] ( http://stackoverflow.com/questions/4210042/exclude-directory-from-find-command )
You can’t perform that action at this time.
0 commit comments