I would like to get all the files from a directory which have a pattern and are not in a .ignore file.
I've tried this command :
find . -name '*.js' | grep -Fxv .ignore but find output is like ./directory/file.js and the format in my .ignore is the following:
*.min.js directory/directory2/* directory/file_56.js So grep does not match any...
Does anyone has an idea/clue of how to do this?
Update So i've found some things but it's not completely working:
find . -name '*.js' -type f $(printf "! -name %s " $(cat .ignore | sed 's/\//\\/g')) | # keeps the path sed 's/^\.\///' | # deleting './' grep -Fxvf .ignore It works (not showing) for *.min.js and directory/file_56.js but not for directory/directory2/*
find . -namewithfind $PWD -nameto see if goes better.gitignore, you'd have better tools available, in terms of being able to askgitto do the work for you.