简体   繁体   中英

How do I locate files which were modified within the last 10 days but and NOT in a “CVS”, “build” or “classes” folder on a bash terminal?

Trying to locate a very specific set of recently changed files within a code repository on a Linux box using a remote terminal session. There are some specific folders names which contain files that are build/SCM cruft that I do not want polluting the real matches I need. No fancy SCM software is available to give me a change list, remember this is just a PuTTY window I have. I am hoping to craft a command that will work on a very spartan linux distribution with few optional packages included.

Something like this should work:

find '(' -name CVS -or -name build -or -name classes -prune ')' -or -mtime +10

The '(' -name CVS -or -name build -or -name classes -prune ')' part skips the directories you want to skip

And -mtime +10 matches files that was modified 10 days ago.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM