<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>IT公司面试手册 &#187; Linux</title>
	<atom:link href="http://www.mianwww.com/html/category/it-interview/linux-it-interview/feed" rel="self" type="application/rss+xml" />
	<link>http://www.mianwww.com</link>
	<description></description>
	<lastBuildDate>Wed, 08 Feb 2012 11:48:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Linux运维工程师面试题</title>
		<link>http://www.mianwww.com/html/2011/11/12264.html</link>
		<comments>http://www.mianwww.com/html/2011/11/12264.html#comments</comments>
		<pubDate>Sat, 26 Nov 2011 15:43:36 +0000</pubDate>
		<dc:creator>jim.jin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.mianwww.com/?p=12264</guid>
		<description><![CDATA[一、有文件file1 1、请用shell查询file1 里面空行的所在行号 awk ‘{if($0~/^$/)print NR}’ file or grep -n ^$ file &#124;awk ‘BEGIN{FS=”:”}{print $1}’ 2、编写ShellScript查询file1 以abc 结尾的行 grep abc$ file1 3、打印出file1 文件第1 到第3 行 sed -n ’1,3p’ file1 head -3 file1 二、如何将本地80 端口的请求转发到8080 端口，当前主机IP 为192.168.2.1 Iptables -A PREROUTING -d 192.168.2.1 -p tcp -m tcp –dport 80 -j DNAT -to-destination 192.168.2.1:8080 三、crontab 在11 月份内，每天的早上6 点到12 [...]]]></description>
		<wfw:commentRss>http://www.mianwww.com/html/2011/11/12264.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>介绍一下Linux内存子系统的调优</title>
		<link>http://www.mianwww.com/html/2011/11/12066.html</link>
		<comments>http://www.mianwww.com/html/2011/11/12066.html#comments</comments>
		<pubDate>Sat, 19 Nov 2011 10:14:47 +0000</pubDate>
		<dc:creator>jim.jin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.mianwww.com/?p=12066</guid>
		<description><![CDATA[内存子系统的调优不是很容易，需要不停地监测来保证内存的改变不会对服务器的其他子系统造成负面影响。如果要改变虚拟内存参数(在/proc/sys/vm)，建议您每次只改变一个参数然后监测效果。对与虚拟内存的调整包括以下几个项目： _ 配置Linux内核如何更新dirty buffers到磁盘。磁盘缓冲区用于暂存磁盘的数据。相对于内存来讲，磁盘缓冲区的速度很慢。因此，如果服务器使用这类内存，性能会成问题。当缓冲区内的数据完全dirty，使用：sysctl -w vm.bdflush=&#8221;30 500 0 0 500 3000 60 20 0&#8243; vm.bdflush有9个参数，但是建议您只改变其中的3个： 1 nfract, 为排队写入磁盘前，bdflush daemon允许的缓冲区最大百分比 2 ndirty, 为bdflush即刻写的最大缓冲区的值。如果这个值很大，bdflush需要更多的时间完成磁盘的数据更新。 7 nfract_sync, 发生同步前，缓冲区变dirty的最大百分比。 配置kswapd daemon，指定Linux的内存交换页数量 sysctl -w vm.kswapd=&#8221;1024 32 64&#8243; 三个参数的描述如下： – tries_base 相当于内核每次所交换的“页”的数量的四倍。对于有很多交换信息的系统，增加这个值可以改进性能。 – tries_min 是每次kswapd swaps出去的pages的最小数量。 – swap_cluster 是kswapd 即刻写如的pages数量。数值小，会提高磁盘I/O的性能；数值大可能也会对请求队列产生负面影响。 如果要对这些参数进行改动，请使用工具vmstat检查对性能的影响。其它可以改进性能的虚拟内存参数为： _ buffermem _ freepages _ overcommit_memory _ page-cluster _ pagecache [...]]]></description>
		<wfw:commentRss>http://www.mianwww.com/html/2011/11/12066.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux 性能调优都有哪几种方法？</title>
		<link>http://www.mianwww.com/html/2011/11/12064.html</link>
		<comments>http://www.mianwww.com/html/2011/11/12064.html#comments</comments>
		<pubDate>Sat, 19 Nov 2011 10:13:57 +0000</pubDate>
		<dc:creator>jim.jin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.mianwww.com/?p=12064</guid>
		<description><![CDATA[1、Disabling daemons （关闭 daemons) 2、Shutting down the GUI (关闭GUI) 3、Changing kernel parameters (改变内核参数） 4、Kernel parameters （内核参数） 5、Tuning the processor subsystem（处理器子系统调优） 6、Tuning the memory subsystem （内存子系统调优） 7、Tuning the file system（文件系统子系统调优） 8、Tuning the network subsystem（网络子系统调优）]]></description>
		<wfw:commentRss>http://www.mianwww.com/html/2011/11/12064.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux文件处理命令都有哪些？</title>
		<link>http://www.mianwww.com/html/2011/11/12062.html</link>
		<comments>http://www.mianwww.com/html/2011/11/12062.html#comments</comments>
		<pubDate>Sat, 19 Nov 2011 10:12:23 +0000</pubDate>
		<dc:creator>jim.jin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.mianwww.com/?p=12062</guid>
		<description><![CDATA[file 1.作用 file通过探测文件内容判断文件类型，使用权限是所有用户。 2.格式 file [options] 文件名 3.[options]主要参数 -v：在标准输出后显示版本信息，并且退出。 -z：探测压缩过的文件类型。 -L：允许符合连接。 -f name：从文件namefile中读取要分析的文件名列表。 4.简单说明 使用file命令可以知道某个文件究竟是二进制（ELF格式）的可执行文件, 还是Shell Script文件，或者是其它的什么格式。file能识别的文件类型有目录、Shell脚本、英文文本、二进制可执行文件、C语言源文件、文本文件、DOS的可执行文件。 5.应用实例 如果我们看到一个没有后缀的文件grap，可以使用下面命令： $ file grap grap： English text 此时系统显示这是一个英文文本文件。需要说明的是，file命令不能探测包括图形、音频、视频等多媒体文件类型。 mkdir 1.作用 mkdir命令的作用是建立名称为dirname的子目录，与MS DOS下的md命令类似，它的使用权限是所有用户。 2.格式 mkdir [options] 目录名 3.[options]主要参数 －m, －－mode=模式：设定权限;，与chmod类似。 －p, －－parents：需要时创建上层目录；如果目录早已存在，则不当作错误。 －v, －－verbose：每次创建新目录都显示信息。 －－version：显示版本信息后离开。 4.应用实例 在进行目录创建时可以设置目录的权限，此时使用的参数是“－m”。假设要创建的目录名是“tsk”，让所有用户都有rwx(即读、写、执行的权限)，那么可以使用以下命令： $ mkdir －m 777 tsk grep 1.作用 grep命令可以指定文件中搜索特定的内容，并将含有这些内容的行标准输出。grep全称是Global Regular Expression Print，表示全局正则表达式版本，它的使用权限是所有用户。 [...]]]></description>
		<wfw:commentRss>http://www.mianwww.com/html/2011/11/12062.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linux查看硬件配置命令都有哪些？</title>
		<link>http://www.mianwww.com/html/2011/11/11968.html</link>
		<comments>http://www.mianwww.com/html/2011/11/11968.html#comments</comments>
		<pubDate>Wed, 16 Nov 2011 12:33:25 +0000</pubDate>
		<dc:creator>jim.jin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.mianwww.com/?p=11968</guid>
		<description><![CDATA[系统 # uname -a # 查看内核/操作系统/CPU信息 # head -n 1 /etc/issue # 查看操作系统版本 # cat /proc/cpuinfo # 查看CPU信息 # hostname # 查看计算机名 # lspci -tv # 列出所有PCI设备 # lsusb -tv # 列出所有USB设备 # lsmod # 列出加载的内核模块 # env # 查看环境变量 资源 # free -m # 查看内存使用量和交换区使用量 # df -h # 查看各分区使用情况 # du -sh # [...]]]></description>
		<wfw:commentRss>http://www.mianwww.com/html/2011/11/11968.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linux上获取本机ip的各种perl写法</title>
		<link>http://www.mianwww.com/html/2011/11/11965.html</link>
		<comments>http://www.mianwww.com/html/2011/11/11965.html#comments</comments>
		<pubDate>Wed, 16 Nov 2011 12:30:40 +0000</pubDate>
		<dc:creator>jim.jin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.mianwww.com/?p=11965</guid>
		<description><![CDATA[　第一种办法，最简单的，调用shell： $ip = `ifconfig eth0&#124;grep -oE &#8216;([0-9]{1,3}\.?){4}&#8217;&#124;head -n 1`; 　　注：这里输入是固定的，所以简单的[0-9]{1,3}了，如果是在web程序等地方验证ip，需要更严谨！ 　　或者 $ip = `ifconfig eth0&#124;awk -F: &#8216;/inet addr/{split($2,a,&#8221; &#8220;);print a[1];exit}&#8217;`; 　　好吧，这样显得太不perl了，而且频繁的调用外部shell不太好，第二种： open FH,&#8221;ifconfig eth0&#124;&#8221;; while(){ last unless /inet addr:((\d{1,3}\.?){4})/; print $1; } 　　看起来稍微perl了一些，虽然实质跟上面的调用shell和grep法是一样的。 　　第三种，更perl一点，纯粹读文件： open FH,&#8217;]]></description>
		<wfw:commentRss>http://www.mianwww.com/html/2011/11/11965.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linux下gcc下makefile文件的编写</title>
		<link>http://www.mianwww.com/html/2011/11/11963.html</link>
		<comments>http://www.mianwww.com/html/2011/11/11963.html#comments</comments>
		<pubDate>Wed, 16 Nov 2011 12:28:49 +0000</pubDate>
		<dc:creator>jim.jin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.mianwww.com/?p=11963</guid>
		<description><![CDATA[假设我们有下面这样的一个程序,源代码如下： /* main.c */ #include &#8220;mytool1.h&#8221; #include &#8220;mytool2.h&#8221; int main(int argc,char **argv) { mytool1_print(&#8220;hello&#8221;); mytool2_print(&#8220;hello&#8221;); } /* mytool1.h */ #ifndef _MYTOOL_1_H #define _MYTOOL_1_H void mytool1_print(char *print_str); #endif /* mytool1.c */ #include &#8220;mytool1.h&#8221; void mytool1_print(char *print_str) { printf(&#8220;This is mytool1 print %s\n&#8221;,print_str); } /* mytool2.h */ #ifndef _MYTOOL_2_H #define _MYTOOL_2_H void mytool2_print(char *print_str); #endif /* mytool2.c [...]]]></description>
		<wfw:commentRss>http://www.mianwww.com/html/2011/11/11963.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux设备驱动程序中的一些具体问题</title>
		<link>http://www.mianwww.com/html/2011/11/11723.html</link>
		<comments>http://www.mianwww.com/html/2011/11/11723.html#comments</comments>
		<pubDate>Wed, 09 Nov 2011 11:34:21 +0000</pubDate>
		<dc:creator>jim.jin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.mianwww.com/?p=11723</guid>
		<description><![CDATA[1。 I/O Port。 和硬件打交道离不开I/O Port，老的ISA设备经常是占用实际的I/O端口，在linux下，操作系统没有对I/O口屏蔽，也就是说，任何驱动程序都可对任意的I/O口操作，这样就很容易引起混乱。每个驱动程序应该自己避免误用端口。 有两个重要的kernel函数可以保证驱动程序做到这一点。 1）check_region(int io_port， int off_set) 这个函数察看系统的I/O表，看是否有别的驱动程序占用某一段I/O口。 参数1：io端口的基地址， 参数2：io端口占用的范围。 返回值：0 没有占用， 非0，已经被占用。 2）request_region(int io_port， int off_set，char *devname) 如果这段I/O端口没有被占用，在我们的驱动程序中就可以使用它。在使用之前，必须向系统登记，以防止被其他程序占用。登记后，在/proc/ioports文件中可以看到你登记的io口。 参数1：io端口的基地址。 参数2：io端口占用的范围。 参数3：使用这段io地址的设备名。 在对I/O口登记后，就可以放心地用inb()， outb()之类的函来访问了。 在一些pci设备中，I/O端口被映射到一段内存中去，要访问这些端口就相当于访问一段内存。经常性的，我们要获得一块内存的物理地址。 2。内存操作 在设备驱动程序中动态开辟内存，不是用malloc，而是kmalloc，或者用get_free_pages直接申请页。释放内存用的是kfree，或free_pages。 请注意，kmalloc等函数返回的是物理地址！ 注意，kmalloc最大只能开辟128k-16，16个字节是被页描述符结构占用了。 内存映射的I/O口，寄存器或者是硬件设备的RAM(如显存)一般占用F0000000以上的地址空间。在驱动程序中不能直接访问，要通过kernel函数vremap获得重新映射以后的地址。 另外，很多硬件需要一块比较大的连续内存用作DMA传送。这块程序需要一直驻留在内存，不能被交换到文件中去。但是kmalloc最多只能开辟128k的内存。 这可以通过牺牲一些系统内存的方法来解决。 　3。中断处理 同处理I/O端口一样，要使用一个中断，必须先向系统登记。 int request_irq(unsigned int irq ，void(*handle)(int，void *，struct pt_regs *)， unsigned int long flags， const char *device); irq: 是要申请的中断。 handle：中断处理函数指针。 [...]]]></description>
		<wfw:commentRss>http://www.mianwww.com/html/2011/11/11723.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何编写Linux操作系统下的设备驱动程序</title>
		<link>http://www.mianwww.com/html/2011/11/11721.html</link>
		<comments>http://www.mianwww.com/html/2011/11/11721.html#comments</comments>
		<pubDate>Wed, 09 Nov 2011 11:33:55 +0000</pubDate>
		<dc:creator>jim.jin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.mianwww.com/?p=11721</guid>
		<description><![CDATA[我们来写一个最简单的字符设备驱动程序。虽然它什么也不做，但是通过它可以了解Linux的设备驱动程序的工作原理。把下面的C代码输入机器，你就会获得一个真正的设备驱动程序。 &#160; #define  __NO_VERSION__ #include #include char kernel_version [] = UTS_RELEASE; 这一段定义了一些版本信息，虽然用处不是很大，但也必不可少。Johnsonm说所有的驱动程序的开头都要包含，一般来讲最好使用。 由于用户进程是通过设备文件同硬件打交道，对设备文件的操作方式不外乎就是一些系统调用，如 open，read，write，close…， 注意，不是fopen， fread，但是如何把系统调用和驱动程序关联起来呢?这需要了解一个非常关键的数据结构： struct file_operations { int (*seek) (struct inode * ，struct file *， off_t ，int); int (*read) (struct inode * ，struct file *， char ，int); int (*write) (struct inode * ，struct file *， off_t ，int); int (*readdir) (struct inode * ，struct [...]]]></description>
		<wfw:commentRss>http://www.mianwww.com/html/2011/11/11721.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux/GNU编程基本知识</title>
		<link>http://www.mianwww.com/html/2011/11/11711.html</link>
		<comments>http://www.mianwww.com/html/2011/11/11711.html#comments</comments>
		<pubDate>Wed, 09 Nov 2011 11:29:28 +0000</pubDate>
		<dc:creator>jim.jin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.mianwww.com/?p=11711</guid>
		<description><![CDATA[1、———————————————————– Linux2.4.x有多少种类型的设备文件？分别写出来。(2分) &#160; 2、———————————————————– glibc动态库的搜寻次序是什么？(2分) glibc 2.1.x 与 2.2.x的动态库的搜寻次序有什么不同？为什么会采用现在的方案？(2分) &#160;]]></description>
		<wfw:commentRss>http://www.mianwww.com/html/2011/11/11711.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

