find forms in a symfony 1.2 project

find apps/ -name "*.svn-base" -prune -o -print -name "*.php" | xargs grep -E 'new .+Form\('
finds all forms instanciated into a symfony project, pruning svn files.

-1
By: ubermuda
2009-02-17 14:56:01

These Might Interest You

  • Edit the YOURPROJECTHERE and YOURPACKAGEHERE and you're done. This is pretty simple but every time I forget how to do it, so let's stick it here.


    0
    project=YOURPROJECTHERE; package=YOURPACKAGEHERE; osc signkey --extend $project; osc rebuildpac project package
    bufferoverflow · 2013-09-27 07:49:41 0
  • create tar.bz2 package from files "-type f" modificated today "-mtime -1" in ~/project


    0
    find ~/project -mtime -1 -type f -print | tar jcvf myfiles.tar.bz2 -T -
    voyeg3r · 2009-03-13 13:03:11 0
  • In this example we search for 'vim' but vim doesn't have a project on github right now. That's ok, this command still searches for every project that has 'vim' in their description (forks, plugins, etc). To get XML or JSON output just replace 'yaml' in the url with 'xml' or 'json'. Show Sample Output


    2
    curl http://github.com/api/v1/yaml/search/vim
    rkulla · 2010-05-30 00:29:03 0
  • change the path where you are, when is executed, is usefule when you've got folders to classify something like a tags, you've got devel/dist, android/ios, etc. like: ~user/Documents/devel/project ~user/Documents/dist/project You can change between devel/project folder to dist/project without leave project. If somebody has a better idea to do that without replace command. Show Sample Output


    0
    changeFolder() { if [ $# -ne 2 ]; then echo "Usage: changeFolder old new"; return; fi; old=$(pwd); folder=$(echo "$old" | sed -e "s/$1/$2/g"); if [ ! -d "$folder" ]; then echo "Folder '$folder' not found."; return; fi; echo "$old -> $folder"; cd $folder;}
    Dracks · 2014-07-29 15:36:32 0

What Others Think

for what it's worth, a quick variant: find apps/ -name "*.svn-base" -prune -o -print -name "*.php" | xargs grep -oE 'new .+Form' | cut -d \ -f 2 | sort | uniq this will output the list of forms instanciated
ubermuda · 487 weeks ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: