chris clarke
software development that works…or something
Unix stuff
October 17, 2007 on 5:58 pm | In Unix |If you work a lot on slow Solaris boxes, you can speed up finds a little bit:
find . -depth -type f -name '*.monkeys'
The depth option looks at the contents of directories before the directory itself and the ‘type f’ constricts the find to only look at regular files. You can speed it up a bit more if you have more information about the file e.g. the owner:
find . -depth -type f -user dev -name '*.monkeys'
Looking for something inside a file and only want to list the files containing your search:
grep -l monkeys *
Working on a box that doesn’t have recursive grep:
find -X . -depth -type f -name '*' | xargs grep -l monkeys
The ‘-X’ option ignores files that would mess with xargs e.g. filenames with spaces in.
No Comments yet »
RSS feed for comments on this post. TrackBack URI
Leave a comment
Unix stuff
October 17, 2007 on 5:58 pm | In Unix |If you work a lot on slow Solaris boxes, you can speed up finds a little bit:
find . -depth -type f -name '*.monkeys'
The depth option looks at the contents of directories before the directory itself and the ‘type f’ constricts the find to only look at regular files. You can speed it up a bit more if you have more information about the file e.g. the owner:
find . -depth -type f -user dev -name '*.monkeys'
Looking for something inside a file and only want to list the files containing your search:
grep -l monkeys *
Working on a box that doesn’t have recursive grep:
find -X . -depth -type f -name '*' | xargs grep -l monkeys
The ‘-X’ option ignores files that would mess with xargs e.g. filenames with spaces in.
No Comments yet »
RSS feed for comments on this post. TrackBack URI
Leave a comment
Powered by Cheese.
RSS Entries Feed.
RSS Comments Feed
^Top^