
Linux学习
文章平均质量分 56
linuw
这个作者很懒,什么都没留下…
展开
-
Linux动态库搜索路径
众所周知, Linux 动态库的默认搜索路径是 /lib 和 /usr/lib 。动态库被创建后,一般都复制到这两个目录中。当程序执行时需要某动态库, 并且该动态库还未加载到内存中,则系统会自动到这两个默认搜索路径中去查找相应的动态库文件,然后加载该文件到内存中,这样程序就可以使用该动态库中的函 数,以及该动态库的其它资源了。在 Linux 中,动态库的搜索路径除了默认的搜索路径外,还可以通过以下转载 2009-12-17 11:43:00 · 499 阅读 · 0 评论 -
vim + ctags/cscope 大型工程代码阅读
Source Insight在大型的工程上使用力不从心,而往往在使用Source Insight建立小的项目时,要查一些API和宏的定义。鉴于此,可以使用vim+cscope的方法,来弥补不足。一般vim是自带了cscope的,如果没有安装,手动添加此文件到.vim目录下参考源:http://cscope.sourceforge.net/cscope_vim_tutorial.html具体配置和使用为:1. 到工程的根目录,建立工程。#cscope –R –b –q2.原创 2010-07-16 11:01:00 · 4399 阅读 · 0 评论 -
[Linux设备驱动第三版]小记 [1-3章]
Chapter 1:Device drivers are distinct “black boxes” that make a particular piece of hardware respond to a well-defined internal programming interface; they hide completely the details of how the dev原创 2010-08-26 13:10:00 · 2169 阅读 · 0 评论 -
Linux下的重要命令
1. 查看某文件夹使用的磁盘空间大小: du -sh $(folder_name). 2. 使用find查找莫文件夹下面的所有某后缀的文件,进行删除操作: find . -name *.o -exec rm {} /; #对当前目录及递归的.o文件执行删除操作. find . -name *.c -exec rm {} /; 3. 将本机的某文件原创 2010-07-27 15:12:00 · 830 阅读 · 0 评论 -
[Linux设备驱动第三版]小记 [4-6章]
Placeholder, add in soon...原创 2011-11-02 17:21:15 · 403 阅读 · 0 评论 -
Linux use notes
-----------------------------Based on Fedora 10 version:-----------------------------1. User can add boot programs through: Just add in file /etc/rc.local.2. Mute telnet alart sound (原创 2010-03-01 20:37:00 · 2873 阅读 · 0 评论 -
shell脚本重要的常识
以下操作对应bash. 1. set -v :在每行脚本命令执行前,先在终端显示出来. sed +v: 关闭. set -x :类似set -v, 但已经对命令做了解析. sed +x: 关闭. 2. pushd/popd. pushd用于将目录压入一个堆栈, popd用于推出. 符合FILO特性. [kenny@sea etc]$ pushd /home原创 2010-08-25 00:04:00 · 2932 阅读 · 0 评论 -
Linux下编译相关
1. configure中的--build, --host, --target含义.Basically, $build* refer to the system compilation is being performed on,$host* refer to the sys原创 2011-04-07 15:02:00 · 469 阅读 · 0 评论 -
makefile重要的常识
<br />1. $$得到目标字符串.<br /> 测试用例(Makefile文件内容):<br /> <br /> SUBDIRS = dir1 dir2 dir3<br /> all:<br /> for n in $(SUBDIRS); do echo $$n; done<br /> for n in $(SUBDIRS); do cd $$n && echo `pwd` && cd ../; done原创 2010-09-04 00:03:00 · 572 阅读 · 0 评论 -
Vi使用
1. 使tab键由默认的8个空格键变为4个空格键 :set tabstop=4 ### try :set all for more info.原创 2010-09-03 21:39:00 · 535 阅读 · 0 评论 -
字符型至整型的转换[toascii]
#include #include /* strlen */#include /* toascii */void usage(){ printf("Usage: toascii /"string/"/n"); printf("See: `man ascii` for more help./n");}int main(int argc, char *argv[]){ if (argc原创 2010-09-12 22:41:00 · 987 阅读 · 0 评论 -
sed使用小结
1. 替换. a. $ echo "aabbcc" | sed -e 's/bb/dd/' ###对标准输入进行替换. 终端的输出为: aaddcc. b. $ sed -e 's/aaa/bbb/' 0$output_file ###将输入文件的所有行首次出现的aaa字符串替换为bbb. 's/.../.../g'模式为每行全替换. c. $ echo "aabbcc" | sed -e 's_bb_dd_' #同a. 可以自由选择不同的分界原创 2010-08-23 23:23:00 · 698 阅读 · 0 评论 -
Linux下telnet登录欢迎界面出现缓慢问题[终端]
原因: 服务器对客户地址进行逆向的DNS解析,而引起时间消耗。 具体的过程为: /etc/nsswitch.conf中的 hosts: files dns,依次会从/etc/hosts 和 /etc/resolv.conf中寻找ip对应域名。方法1: 在文件/etc/hosts中加入ip到主机名的对应关系; 或 在文件/etc/resolv.conf中直接指定nameserver 服务器IP排第一个.方法2: 在图形界面下, system -> ad原创 2010-07-27 23:46:00 · 3147 阅读 · 0 评论 -
虚拟机下Linux单击变双击问题的解决办法
已测试环境为(Vmware 6.0 + Fedora 9) a. 编辑文件xorg.conf $ vi /etc/X11/xorg.conf b. 增加如下内容 Section "ServerFlags" Option "AutoAddDevices" "false"EndSection c. 保存,重启系统 即原创 2010-05-27 14:28:00 · 1297 阅读 · 0 评论 -
Debugging with GDB
Debugging with GDB From: http://hi.baidu.com/wenquan%5Fxu/blog/item/9c601960ab0dfcdc8db10d9e.html Debug 是大家常常用到的东西.不管是自己写程序也好,还是想改改别人写好的东西, 又或者帮人家捉捉虫.总之呢,绝对是个常常用的到的东西.Dos, windows 底下,通常大家都在转载 2009-12-24 12:12:00 · 777 阅读 · 0 评论 -
Shared Library Search Paths
Shared Library Search Paths[related: GNU Binutils - ld]From: http://www.eyrie.org/~eagle/notes/rpath.htmlSee: http://www.tldp.org/HOWTO/Program-Library-HOWTO/ Its becoming more an转载 2009-12-17 15:58:00 · 1757 阅读 · 0 评论 -
gcc下__attribute__ ((constructor))和__attribute__ ((destructor))的使用
__attribute__ ((constructor))指定的函数在共享库loading的时候调用,__attribute__ ((destructor))在共享库unloading的时候调用。1. 编写源码文件ktest.c如下. #include __attribute__ ((constructor)) static void ktest_init(void);__attribute__ ((destructor)) static void ktest_deinit(void);v原创 2010-12-01 17:16:00 · 5243 阅读 · 0 评论