收藏一个比较好的ubuntu配置手册 http://hi.baidu.com/smilewin/item/b946de148b5d61423a176ece
常用命令 (要掌握的主要命令,有不对的地方还请各位指正)
Contents
[hide]软件安装与卸载[edit]
apt-get install zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs sudo apt-get autoremove google-chrome-stable sudo dpkg -r lvpm
版本查看[edit]
gcc -v g++ -v java --version
ln[edit]
sudo ln -sf javac /usr/lib/jvm/jdk1.6.0_45/bin/javac sudo ln -s g++-4.4 g++
update-alternatives[edit]
sudo update-alternatives --config java sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm//usr/lib/jvm/jdk1.6.0_45/bin/java 300
cd[edit]
cd ~ cd .. cd ../.. cd ... cd Android/
chmod[edit]
chmod a+x ~/bin/repo sudo chmod 777 app_process_gaia sudo chmod -R 777 ~/java/SDK_11_1 sudo chmod +x install
cp[edit]
cp -a android-sdk_eng.ju_linux-x86 /media/软件/Linux sudo cp jdk-6u27-linux-i586.bin /usr/lib/jvm cp -r ./usr/* /usr/
mv[edit]
mv adt-bundle-linux-x86_64-20131030 /host
rm[edit]
rm com.gaia.gdt/META-INF/MANIFEST.MF.orig rm -f app_process_gaia rm -rf .git sudo rm -r repo
find[edit]
file app_process_gaia find /media/软件/Linux/wuwei/out -name system.img find . '-name' '*.java' >adtjavalist find . -name *.java | xargs wc -l >adttotalline find / -name "*.log" find -name "*.*" |xargs grep -rnws PARENT_LOC >test find -r /Downloads/eclipse插件测试/workspace/com.android.ide.eclipse.adt "/home/ju/Downloads/eclipse插件测试" find . -type d > adtpackagelist find wc -l wc -l *.java sudo find -mtime -1
grep[edit]
grep -nir 'missing required attribute name' ./ grep -nir origin/cadt .git grep -r "/host/adt-bundle-linux-x86_64-20131030/sdk/platform-tools/adb" ~/Downloads grep -rl "/home/ju/Downloads/eclipse插件测试" /home/ju/Downloads/eclipse插件测试/workspace/com.android.ide.eclipse.adt grep -rn "插件测试" /home/ju/Downloads/eclipse/adtworkspace -l
history[edit]
history history |cut -f2- -d' ' |sort|uniq history |sed 's/^\s\+//' |cut -f2- -d' '|sort|uniq|sed 's:^\s\+::' >mycmd
ls[edit]
ll ls ls -a ls -alh ls -a .repo ls build ls build -la ls .git/config ls -la | grep 1.7 ls -la java* ls -la /usr/bin/java ls -l g++*
cat[edit]
cat .git/config
git[edit]
git -a git add git add . git add com.gaia.gdt/schema/COSWizard.exsd com.gaia.gdt/src/com/cos/gdt/ git branch git branch -a git branch -av git branch -b bug325 git branch -d branch_1_8 git branch -d -r origin/appwizard git checkout git checkout -b bug325 git checkout branch_1_8 git checkout -b xxxx 754cad81c7bc7d2c2fb1297366721c2aa56142e3 git checkout --<file>com.gaia.gdt/src/com/gaia/gdt/Activator.java git checkout remotes/origin/aosp-new/android-4.4_r1.2 git commit -a git commit -am 'bug 323 (part 2) resolve commit conflicts.' git commit -a -m "格式修改" git commit -a "恢复对pkgname是否为空的检查" git commit -m "bug323 1.8.3项目中gaia改为cos for sdk11" git -d git diff com.gaia.gdt/META-INF/MANIFEST.MF --staged git diff f40ce0f2394929d1fd3f54608ee9dc236e0e9658 71b721fc8f780d07ea1fb5417d38bd2535fdf449 -U8 >bug391.patch git diff -rq git diff -vq git diff -U8 --patience -M -C >bug357.WIP.patch git fetch -v git help bisect gitk git log -n 3 git mergetool git pull orgin branch_1_8_for_SDK_11 git push origin master git rebase origin branch_1_8_for_SDK_11 git reset --hard git status
adb[edit]
adb adb devices /home/ju/java/SDK_11_1/prebuilt/linux-x86/bin/adb -s HT336W900158 pull /system/bin/app_process_gaia /home/ju/java/SDK_11_1/build/bin sudo ./prebuilt/linux-x86/bin/adb kill-server ./prebuilt/linux-x86/bin/adb pull /system/bin/app_process_gaia build/
curl[edit]
curl "http://php.webtutor.pl/en/wp-content/uploads/2011/09/repo" >/home/ju/Android/bin/repo
repo[edit]
repo init -u git://android.git.kernel.org/platform/manifest.git /host/Android/bin/repo init -u https://android.googlesource.com/platform/manifest /host/Android/bin/repo init -u https://android.googlesource.com/platform/manifest -b android-4.3_r2.1 .repo/manifests$ git branch -al repo sync until /host/Andoird/bin/repo/repo sync; do echo hello; done
android[edit]
android create avd -t 1 -n myavd android list
emulator[edit]
emulator emulator -avd myavd emulator -kernel /host/Android/prebuilts/qemu-kernel/arm/kernel-qemu -image out/target/product/generic/system.img -data /host/Android/out/target/product/generic/userdata.img -ramdisk /host/Android/out/target/product/generic/ramdisk.img /host/adt-bundle-linux-x86_64-20131030/sdk/tools/emulator -sysdir $PWD -kernel system.img -data userdata.img -ramdisk ramdisk.img
编辑文件[edit]
vi com.gaia.gdt/META-INF/MANIFEST.MF sudo gedit bash.bashrc gvim /home/ju/gaia/com.gaia.gdt/src/com/gaia/gdt/debug/PreDebugThread.java set listchars=tab:>-,trail:- gvim set listchars=tab:>-,trail:-
tar[edit]
tar -czvf android4.3.tar.gz abi bin bionic bootable build cts dalvik developers development tar jcvf sdkout.tar.bz2 /host/Android/sdkout tar zxvf AdbeRdr9.5.3-1_i486linux_enu.tar.bz2
文件传输[edit]
scp -r android4.3.tar.gz ju@192.168.160.46:/home/ftp/ju ssh ju@dev
source[edit]
sudo source /home/ghoul/.bashrc source build/envsetup.sh