Difference between revisions of "Linux Tools"
From Healthcare Robotics Wiki
Advaitjain (Talk | contribs) (→command line tools: find, sed etc.) |
Advaitjain (Talk | contribs) (→command line tools: find, sed etc.) |
||
| Line 27: | Line 27: | ||
#* rm -rvf `find . -name "*.svn"` | #* rm -rvf `find . -name "*.svn"` | ||
#recursively remove all the .pycs | #recursively remove all the .pycs | ||
| − | #* alias rmpyc='rm -vf *.pyc; rm -vf `find . -name *.pyc` | + | #* alias rmpyc='rm -vf *.pyc; rm -vf `find . -name *.pyc`' |
# remove the pesky .pycs from the repository | # remove the pesky .pycs from the repository | ||
#* svn rm `find . -name "*.pyc"` | #* svn rm `find . -name "*.pyc"` | ||
| Line 33: | Line 33: | ||
'''So is sed:''' | '''So is sed:''' | ||
# replace update_path with load_manifest. (-i is doing an in-place replace, I believe) | # replace update_path with load_manifest. (-i is doing an in-place replace, I believe) | ||
| − | #* sed -i 's/update_path/load_manifest/' `find . -name "*.py"` | + | #* sed -i 's/update_path/load_manifest/' `find . -name "*.py"` |
Revision as of 13:50, 17 October 2009
ssh-keygen
To be able to ssh to another machine without needing to type your passwd:
Generate keys: $ ssh-keygen -t rsa -b 1024
Use the default file name and empty pass phrase for password less authentication. This will generate keys in
$ .ssh/id_rsa.pub
Then secure shell copy to another host as authorized_keys
$ scp ~/.ssh/id_rsa.pub <machine name>:~/.ssh/authorized_keys
Instructions copied from: http://pr.willowgarage.com/wiki/GB_ssh-keygen
Additional keys can be named authorized_keys2 and so on.
command line tools: find, sed etc.
The find command is pretty nifty:
- find all directories whose name does not contain svn
- find . ! -path "*.svn*" -type d
- remove .svn folders, e.g. after copying a directory which is a local copy of a subversion repository
- rm -rvf `find . -name "*.svn"`
- recursively remove all the .pycs
- alias rmpyc='rm -vf *.pyc; rm -vf `find . -name *.pyc`'
- remove the pesky .pycs from the repository
- svn rm `find . -name "*.pyc"`
So is sed:
- replace update_path with load_manifest. (-i is doing an in-place replace, I believe)
- sed -i 's/update_path/load_manifest/' `find . -name "*.py"`