摘要: 文件系统:du -sh * 列出所有的文件夹大小du -s | sort -rn 从小到大排序文件夹df 比较文件grep 'expr' dir 在dir文件夹里边查找含有expr的文件lsof 列出打开的文件tar:-t 列出归档文件内容-r 追加到归档文件末尾Terminal:sodu !! 运行前一条命令网络:netstat -tulnp 查看进程占用端口iptables -L 查看防火墙设置ldd 查看依赖文件pstree 列出进程树python -m SimpleHTTPServer http方式共享当前文件夹mount -o size=1500M -o nr_ino 阅读全文
posted @ 2012-01-04 16:00 leaving 阅读(1855) 评论(0) 推荐(1) 编辑
  2016年2月29日
摘要: tig简介 tig是git的命令行可视化工具,可以方便地在命令行下完成git的各种操作 tig安装 Ubuntu: apt-get install tig Mac: brew install tig 使用 命令行进入git项目代码目录, tig 即可进入tig界面,默认为当前分支 tig branc 阅读全文
posted @ 2016-02-29 21:02 leaving 阅读(5293) 评论(0) 推荐(0) 编辑
  2014年7月11日
摘要: 1. arm-linux-gcc:http://download.csdn.net/download/zlyong0018/46463772. adb makefile:https://gist.github.com/splhack/9583353. 修改CC为arm-linux-gcc4. mak... 阅读全文
posted @ 2014-07-11 11:09 leaving 阅读(374) 评论(0) 推荐(0) 编辑
  2013年4月7日
摘要: 1,防止一个头文件被重复包含#ifndef BODYDEF_H#define BODYDEF_H //头文件内容#endif2,得到指定地址上的一个字节或字#define MEM_B( x ) ( *( (byte *) (x) ) )#define MEM_W( x ) ( *( (word *) (x) ) )3,得到一个field在结构体(struct)中的偏移量#define FPOS( type, field ) ( (dword) &(( type *) 0)-> field )4,得到一个结构体中field所占用的字节数#define FSIZ( type, fie 阅读全文
posted @ 2013-04-07 21:58 leaving 阅读(178) 评论(0) 推荐(0) 编辑
  2013年2月14日
摘要: 1. 删除乱码文件名文件:使用find命令 ls -il 查找inode号 find -inum 12345 -exec rm '{}' \;2. 查看某个文件 阅读全文
posted @ 2013-02-14 18:11 leaving 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 1。strace调试 strace ls strace -e ls 查看命令调用的systemcall strace -e trace=open,read ls / strace -o output.txt ls strace -t -p pid -o output.txt 跟踪pid进程,输出到output.txt文件中,并且添加时间戳 阅读全文
posted @ 2013-02-14 17:15 leaving 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 1. 打开所有的编译时警告: -Wall gcc main.c -o main -Wall2. 只生成预编译文件: -E gcc -E main.c > main.i3. 只生存汇编文件: -S gcc -S main.c > main.s4. 只生成编译后代码: -C gcc -C main.c5. 生成中间临时文件: -save-temps gcc -save-temps main.c6. 动态库以及使用 gcc -shared -fPIC -o libmy.so my.c gcc -o p2 main.c ./libmy.so -Iinclude 或者 gcc -Lso... 阅读全文
posted @ 2013-02-14 15:29 leaving 阅读(262) 评论(0) 推荐(0) 编辑
  2013年2月7日
摘要: 1. build: 添加依赖库 -l: gcc test.c -lz 此为依赖libz库 添加包含文件目录 -I: gcc test.c -I/usr/include/2. 查找某个库是否在搜索路径下: ldconfig -p 阅读全文
posted @ 2013-02-07 17:13 leaving 阅读(130) 评论(0) 推荐(0) 编辑
  2012年11月6日
摘要: 1.git log --all --graph --pretty=oneline2. 阅读全文
posted @ 2012-11-06 13:36 leaving 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 1. alt+, 后退2. alt+. 前进3. alt+/ 弹出窗口显示符号信息4. ctrl+= 跳转到定义处 阅读全文
posted @ 2012-11-06 13:29 leaving 阅读(140) 评论(0) 推荐(0) 编辑
  2012年10月7日
摘要: 1. download boost2. executetools\build\v2\engine\build.bat3. copy bjam.exe to boostroot4. bjam --with-thread --with-date_time --with-serialization --with-regex --toolset=msvc-10.05.#include <iostream>#include <boost/asio.hpp>#include <boost/bind.hpp>#include <boost/thread/thread 阅读全文
posted @ 2012-10-07 12:53 leaving 阅读(248) 评论(0) 推荐(0) 编辑