2012年12月18日 星期二
2012年3月22日 星期四
some string related tips
0. replace strings for all files in a folder
find ./ | xargs grep -l "$STRING_TO_BE_REPLACED" | xargs sed -i -e "s/$STRING_TO_BE_REPLACED/$STRING_TO_REPLACE/g"
0. find files and then grep som key word
find ./ -iname '$FILE_NAMES*' | xargs grep $SEARCH_KEY_WORDS
0. find files and then remove
find ./ -iname '$FILE_NAMES*' | xargs rm -rf
0. find and push multiple files from adb
find ./ -iname *.ko | xargs -t -i adb push {} /system/lib/modules/
0. Search multiple words in VIM
/\(kernel\|panic\); you will search both kernel and panic at the same time
0. Copy and rename multiple filse
for i in `find ./ -iname "*file_name*"`; do cp $i `echo $i | sed "s/$STRING_TO_BE_REPLACED/$STRING_TO_REPLACE/g"`; done
find ./ | xargs grep -l "$STRING_TO_BE_REPLACED" | xargs sed -i -e "s/$STRING_TO_BE_REPLACED/$STRING_TO_REPLACE/g"
0. find files and then grep som key word
find ./ -iname '$FILE_NAMES*' | xargs grep $SEARCH_KEY_WORDS
0. find files and then remove
find ./ -iname '$FILE_NAMES*' | xargs rm -rf
0. find and push multiple files from adb
find ./ -iname *.ko | xargs -t -i adb push {} /system/lib/modules/
0. Search multiple words in VIM
/\(kernel\|panic\); you will search both kernel and panic at the same time
0. Copy and rename multiple filse
for i in `find ./ -iname "*file_name*"`; do cp $i `echo $i | sed "s/$STRING_TO_BE_REPLACED/$STRING_TO_REPLACE/g"`; done
訂閱:
文章 (Atom)
標籤
- 生活
- 閒聊
- android
- arm
- assembly
- beaglebone black
- bl
- business trip
- car rental
- coupon
- cross compile
- cygwin iphone toolchain install build
- dropbear
- embedded system
- find
- GDB
- gdbserver
- grep
- instruction
- io
- kinect
- life
- linux
- openni
- programming
- QT visual studio express 2008 install
- qualcomm
- qualcomm business trip
- replace
- rild
- san diego
- ssh
- substitute
- system realated
- toolchain
- ubuntu
- vim ^M 換行
- Windows CE VM