3 Jul

Unix Tips

Simple Ruby Commands

ssh

Login without Password

$cd ~/.ssh
$ ssh-keygen -t rsa
$ cat id_rsa.pub |ssh lifidea@lifidea.com 'cat >> .ssh/authorized_keys'

xargs

cp

#mv (sydney)
find spam_2/ -type f|head -100|xargs -i mv {} ./spam

#Substitute % into input from stdin
$ find . |tail -10 |xargs -J % cp % ../spam_s/

#ungzip
find /work2/COLLECTIONS/blogdata/ -name 'feeds*.gz'|xargs gzip -c -d > trecblog_feed.docs   

awk

grep ^\<title topics.1-50 topics.51-100 |awk -F':' '{print $3}' > query_title.1-100

wget

#Crawl Website, only for changes, with .html extension
wget -o cs.log -r -l 10 -N -E -k -D umass.edu "http://www.cs.umass.edu":http://www.cs.umass.edu

screen

Tags : Dev Print Comments Trackback