Skip to content

Instantly share code, notes, and snippets.

@keeperofthenecklace
Last active October 8, 2015 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keeperofthenecklace/3394165 to your computer and use it in GitHub Desktop.
Save keeperofthenecklace/3394165 to your computer and use it in GitHub Desktop.
Grep Commands
cd ../..
grep -Rni 'albert' .
pwd - displays path
grep -ir acts_as_json - display acts_as_jason in which file
gem list | grep rspec - list all rspec associated files
gem list | grep friendly_id
grep rspec Gemfile.lock - displays all rpec gem in the gemfile.lock. You shud b in dir.
bundle - install gems from gemfile
rvm help
which rvm
rvm reload
sudo mv spec spec.system
bundle exec rspec spec/controllers/brigades_controller_spec.rb
gem search -r attachment
*****************
shell scripting
---------------
searching in directory
$zsh
$ % find . -name '*.rb' -mtime -3 #mtime = modified time less than 3 days
$ cd rails app
$ find . -name '*.rb' | xargs grep albert
$ find . -name '*.rb' | xargs ack albert
replacing names
--------------
find . -name '*.rb' | sed -i 's/albert/kwame/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment