Wednesday, May 26, 2010

quick commandline trick: find files that you can write to

Here's a trick I found useful today:
find . -writable -type f

find (rtfm) can do all kinds of crazy things. What this does is list out all the files under the current directory that aren't directories, and that you have write access to. Useful for Perforce users -- in p4, if a file is writable, either you're editing it in a change list, or you just accidentally made it writable and you should be editing it in a change list.

2 comments:

jes5199.com said...

no project that uses perforce is worth working on, though,

Alex Rudnick said...

Ooh, burnsauce!