Last active
October 8, 2015 21:48
-
-
Save keeperofthenecklace/3394165 to your computer and use it in GitHub Desktop.
Grep Commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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