Thursday, May 29, 2014

OSX Find Command to Exclude Directory

Given this directory structure, let's get a list of all files that are not in the node_modules directory.

Given Directory Structure


$ git add-commit 'added frontend'
$ tree -C -d -L 2
.
├── javascript
├── less
├── node_modules
│   ├── grunt
│   ├── grunt-cli
│   ├── grunt-contrib-concat
│   ├── grunt-contrib-less
│   ├── grunt-contrib-uglify
│   └── grunt-contrib-watch
└── public
    ├── css
    └── js


Find command to exclude node_modules


$ find . -not -path "*node_modules*" -type f
./Gruntfile.js
./javascript/app.js
./javascript/function.js
./less/style.less
./package.json
./public/css/style.css
./public/index.html


2 comments:

  1. I think mimicking popular posts on other blogs is one of the best ways to get a good idea which will be popular.Such a lovely blog you have shared here with us. Really nice.
    ______________________
    Clipping Magic

    ReplyDelete
  2. Despite if some person chase down his key thing, thus he/she desires to be open that in unobtrusive component, in this way that thing is kept up here.
    Video player for Mac

    ReplyDelete