﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客--随笔分类-Linux</title><link>http://www.cppblog.com/hkingSP/category/21380.html</link><description /><language>zh-cn</language><lastBuildDate>Fri, 24 Apr 2020 03:48:33 GMT</lastBuildDate><pubDate>Fri, 24 Apr 2020 03:48:33 GMT</pubDate><ttl>60</ttl><item><title>unix/windows回车问题(\r\n or \n) or shell脚本执行错误 $'\r':command not found</title><link>http://www.cppblog.com/hkingSP/archive/2019/10/25/216956.html</link><dc:creator>宋鹏</dc:creator><author>宋鹏</author><pubDate>Fri, 25 Oct 2019 02:41:00 GMT</pubDate><guid>http://www.cppblog.com/hkingSP/archive/2019/10/25/216956.html</guid><wfw:comment>http://www.cppblog.com/hkingSP/comments/216956.html</wfw:comment><comments>http://www.cppblog.com/hkingSP/archive/2019/10/25/216956.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/hkingSP/comments/commentRss/216956.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/hkingSP/services/trackbacks/216956.html</trackback:ping><description><![CDATA[<div>unix/windows回车问题</div><div>shell脚本执行错误 $'\r':command not found<br />存现这种错误是因为 编写的&nbsp; shell脚本是在win下编写的，每行结尾是\r\n 的Unix 结果行是\n&nbsp;&nbsp;<br />所以在Linux下运行脚本 会任务\r 是一个字符，所以运行错误，需要把文件转换下。</div><div>1.单个文件转换：</div><div>运行脚本&nbsp;</div><div>&nbsp;dos2unix&nbsp; 脚本名</div><div>OK</div><div>2.整个目录中的文件做dos2unix操作:</div><div>$ find . -type f -exec dos2unix {} \;</div><div>其中具体命令的解释如下：</div><div>find .</div><div>= find files in the current directory</div><div>-type f</div><div>= of type f</div><div>-exec dos2unix {} \;</div><div>= and execute dos2unix on each file found<br /><br />参考：<br /><a href="https://blog.csdn.net/Lnho2015/article/details/51322289">https://blog.csdn.net/Lnho2015/article/details/51322289<br /><a href="https://blog.csdn.net/yuliying/article/details/75912021">https://blog.csdn.net/yuliying/article/details/75912021</a><br /><a href="https://blog.csdn.net/liuxiangke0210/article/details/80395707">https://blog.csdn.net/liuxiangke0210/article/details/80395707</a><br /><br /></a></div><img src ="http://www.cppblog.com/hkingSP/aggbug/216956.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hkingSP/" target="_blank">宋鹏</a> 2019-10-25 10:41 <a href="http://www.cppblog.com/hkingSP/archive/2019/10/25/216956.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>编译 linux kernel package .ko</title><link>http://www.cppblog.com/hkingSP/archive/2019/10/10/216905.html</link><dc:creator>宋鹏</dc:creator><author>宋鹏</author><pubDate>Thu, 10 Oct 2019 02:50:00 GMT</pubDate><guid>http://www.cppblog.com/hkingSP/archive/2019/10/10/216905.html</guid><wfw:comment>http://www.cppblog.com/hkingSP/comments/216905.html</wfw:comment><comments>http://www.cppblog.com/hkingSP/archive/2019/10/10/216905.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/hkingSP/comments/commentRss/216905.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/hkingSP/services/trackbacks/216905.html</trackback:ping><description><![CDATA[<pre style="white-space: pre-wrap;">工具和代码准备：
sudo&nbsp;apt-get&nbsp;install&nbsp;build-essential&nbsp;linux-source&nbsp;bc&nbsp;kmod&nbsp;cpio&nbsp;flex&nbsp;cpio&nbsp;libncurses5-dev<br />Full source:    <a rel="nofollow" href="https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.4.167.tar.xz">https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.4.167.tar.xz<br />t</a>ar xvf linux-4.4.167.tar.xz
检查架构：
<div>dpkg --print-architecture</div>内核配置，
<strong>使用arch/arm64/configs/defconfig下面的默认配置进行编译</strong>：<br />make ARCH=arm64&nbsp;defconfig
<strong>`make oldconfig` reads the .config file in the current directory and prompts you about any new changes to the kernel:</strong><br />make oldconfig&amp;&amp;make prepare&amp;&amp;make scripts
ko代码编译：<br /><div>make 4_4_167_smp_x64<br />检查version magic：
modinfo bizwsd.ko</div>
</pre><img src ="http://www.cppblog.com/hkingSP/aggbug/216905.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hkingSP/" target="_blank">宋鹏</a> 2019-10-10 10:50 <a href="http://www.cppblog.com/hkingSP/archive/2019/10/10/216905.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>vi 初始设置，切换到非兼容模式，防止上下右左 变成 ABCD</title><link>http://www.cppblog.com/hkingSP/archive/2019/09/06/216778.html</link><dc:creator>宋鹏</dc:creator><author>宋鹏</author><pubDate>Fri, 06 Sep 2019 01:40:00 GMT</pubDate><guid>http://www.cppblog.com/hkingSP/archive/2019/09/06/216778.html</guid><wfw:comment>http://www.cppblog.com/hkingSP/comments/216778.html</wfw:comment><comments>http://www.cppblog.com/hkingSP/archive/2019/09/06/216778.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/hkingSP/comments/commentRss/216778.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/hkingSP/services/trackbacks/216778.html</trackback:ping><description><![CDATA[<p style="margin: 0px 0px 1em; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: inherit; font-family: Arial, &quot;Helvetica Neue&quot;, Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; box-sizing: inherit; clear: both; color: #242729; background-color: #ffffff;">If you don't already have a&nbsp;<code style="margin: 0px; padding: 1px 5px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, &quot;Lucida Console&quot;, &quot;Liberation Mono&quot;, &quot;DejaVu Sans Mono&quot;, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, monospace, sans-serif; font-size: 13px; vertical-align: baseline; box-sizing: inherit; background-color: #eff0f1; white-space: pre-wrap;">.vimrc</code>&nbsp;file in your home directory, create one using this:</p><pre style="margin-top: 0px; margin-bottom: 1em; padding: 12px 8px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, &quot;Lucida Console&quot;, &quot;Liberation Mono&quot;, &quot;DejaVu Sans Mono&quot;, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, monospace, sans-serif; font-size: 13px; vertical-align: baseline; box-sizing: inherit; width: auto; max-height: 600px; overflow: auto; background-color: #eff0f1; border-radius: 3px; overflow-wrap: normal; color: #242729;"><code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, &quot;Lucida Console&quot;, &quot;Liberation Mono&quot;, &quot;DejaVu Sans Mono&quot;, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, monospace, sans-serif; vertical-align: baseline; box-sizing: inherit; white-space: inherit;">vim ~/.vimrc </code></pre><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: inherit; font-family: Arial, &quot;Helvetica Neue&quot;, Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; box-sizing: inherit; clear: both; color: #242729; background-color: #ffffff;">Add this line to the top of the file:</p><pre style="margin-top: 0px; margin-bottom: 1em; padding: 12px 8px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, &quot;Lucida Console&quot;, &quot;Liberation Mono&quot;, &quot;DejaVu Sans Mono&quot;, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, monospace, sans-serif; font-size: 13px; vertical-align: baseline; box-sizing: inherit; width: auto; max-height: 600px; overflow: auto; background-color: #eff0f1; border-radius: 3px; overflow-wrap: normal; color: #242729;"><code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, &quot;Lucida Console&quot;, &quot;Liberation Mono&quot;, &quot;DejaVu Sans Mono&quot;, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, monospace, sans-serif; vertical-align: baseline; box-sizing: inherit; white-space: inherit;">set nocompatible </code></pre><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: inherit; font-family: Arial, &quot;Helvetica Neue&quot;, Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; box-sizing: inherit; clear: both; color: #242729; background-color: #ffffff;">Save the file and this should fix the problem for you. :)<br /><br />解释 何为兼容模式：<br />初装linux，vi 启动的时候，会运行在兼容模式，此兼容模式是兼容old vi，所以会有这种情况。<br />此模式下，所有vi后来的改进都是关闭的。<br /><br /><br /></p><img src ="http://www.cppblog.com/hkingSP/aggbug/216778.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hkingSP/" target="_blank">宋鹏</a> 2019-09-06 09:40 <a href="http://www.cppblog.com/hkingSP/archive/2019/09/06/216778.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Linux 快捷方式(软/英链接)/ln命令用法</title><link>http://www.cppblog.com/hkingSP/archive/2019/03/03/216280.html</link><dc:creator>宋鹏</dc:creator><author>宋鹏</author><pubDate>Sun, 03 Mar 2019 03:24:00 GMT</pubDate><guid>http://www.cppblog.com/hkingSP/archive/2019/03/03/216280.html</guid><wfw:comment>http://www.cppblog.com/hkingSP/comments/216280.html</wfw:comment><comments>http://www.cppblog.com/hkingSP/archive/2019/03/03/216280.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/hkingSP/comments/commentRss/216280.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/hkingSP/services/trackbacks/216280.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 例子：虚拟机文件夹共享到桌面ln -s /mnt/hgfs/shared-directory ~/Desktop/Name-of-the-folder&nbsp;&nbsp;文章转自https://www.cnblogs.com/pingzhe/p/8462350.html：一、介绍ln命令用于将一个文件创建链接,链接分为软链接(类似于windows系统中的快捷方式)和硬链接(相当于对源文件cop...&nbsp;&nbsp;<a href='http://www.cppblog.com/hkingSP/archive/2019/03/03/216280.html'>阅读全文</a><img src ="http://www.cppblog.com/hkingSP/aggbug/216280.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hkingSP/" target="_blank">宋鹏</a> 2019-03-03 11:24 <a href="http://www.cppblog.com/hkingSP/archive/2019/03/03/216280.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Vim 配置</title><link>http://www.cppblog.com/hkingSP/archive/2019/03/03/216279.html</link><dc:creator>宋鹏</dc:creator><author>宋鹏</author><pubDate>Sun, 03 Mar 2019 02:54:00 GMT</pubDate><guid>http://www.cppblog.com/hkingSP/archive/2019/03/03/216279.html</guid><wfw:comment>http://www.cppblog.com/hkingSP/comments/216279.html</wfw:comment><comments>http://www.cppblog.com/hkingSP/archive/2019/03/03/216279.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/hkingSP/comments/commentRss/216279.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/hkingSP/services/trackbacks/216279.html</trackback:ping><description><![CDATA[<strong style="font-size: 10pt; font-family: Arial; color: #000000; background-color: #ffffff;">系统位置：</strong><br style="font-size: 10pt; font-family: Arial; color: #000000; background-color: #ffffff;" /><span style="font-size: 10pt; font-family: Arial; color: #000000; background-color: #ffffff;">/etc/vim/vimrc</span><br style="font-size: 10pt; font-family: Arial; color: #000000; background-color: #ffffff;" /><br style="font-size: 10pt; font-family: Arial; color: #000000; background-color: #ffffff;" /><strong style="font-size: 10pt; font-family: Arial; color: #000000; background-color: #ffffff;">用户位置（默认无）：</strong><br style="font-size: 10pt; font-family: Arial; color: #000000; background-color: #ffffff;" /><span style="font-size: 10pt; font-family: Arial; color: #000000; background-color: #ffffff;">~/.vimrc</span><br style="font-size: 10pt; font-family: Arial; color: #000000; background-color: #ffffff;" /><br style="font-size: 10pt; font-family: Arial; color: #000000; background-color: #ffffff;" /><strong style="font-size: 10pt; font-family: Arial; color: #000000; background-color: #ffffff;">Vim 配置颜色主题：</strong><br style="font-size: 10pt; font-family: Arial; color: #000000; background-color: #ffffff;" /><div style="font-size: 10pt; font-family: Arial; color: #000000; background-color: #ffffff;">https://vimcolors.com/<br /><br /></div><strong style="font-size: 10pt; font-family: Arial; color: #000000; background-color: #ffffff;">Vim 配置下载的theme：</strong><br style="font-size: 10pt; font-family: Arial; color: #000000; background-color: #ffffff;" /><span style="font-size: 10pt; font-family: Arial; color: #000000; background-color: #ffffff;">到上面的网站下载sometheme.vim文件</span><br style="font-size: 10pt; font-family: Arial; color: #000000; background-color: #ffffff;" /><span style="font-size: 10pt; font-family: Arial; color: #000000; background-color: #ffffff;">放到 ～/.vim/colors下面</span><br style="font-size: 10pt; font-family: Arial; color: #000000; background-color: #ffffff;" /><span style="font-size: 10pt; font-family: Arial; color: #000000; background-color: #ffffff;">.vimrc中加入：color sometheme</span><br style="font-size: 10pt; font-family: Arial; color: #000000; background-color: #ffffff;" /><span style="font-size: 10pt; font-family: Arial; color: #000000; background-color: #ffffff;">.vimrc中加入：syntax on&nbsp;</span><br style="font-size: 10pt; font-family: Arial; color: #000000; background-color: #ffffff;" /><div style="font-size: 10pt; font-family: Arial; color: #000000; background-color: #ffffff;"><span style="color: #dd1144; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; background-color: #f7f7f9;"><br /></span><span style="color: #000000; font-family: Arial; font-size: 10pt; background-color: #ffffff;"><strong>.vimrc内容：</strong></span><span style="color: #000000; font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; font-size: 12px; background-color: #ffffff;"><br /></span><div><span style="font-family: Arial; font-size: 10pt; color: #000000; background-color: #ffffff;">" 显示行号</span></div><div><span style="font-family: Arial; font-size: 10pt; color: #000000; background-color: #ffffff;">&nbsp;set nu</span></div><div><span style="font-family: Arial; font-size: 10pt; color: #000000; background-color: #ffffff;">" 缩进空格数</span></div><div><span style="font-family: Arial; font-size: 10pt; color: #000000; background-color: #ffffff;">set tabstop=4</span><br /><span style="font-family: Arial; font-size: 10pt; color: #000000; background-color: #ffffff;">" 颜色主题</span><br /><span style="font-family: Arial; font-size: 10pt; color: #000000; background-color: #ffffff;">color railscasts</span><br /><span style="font-family: Arial; font-size: 10pt; color: #000000; background-color: #ffffff;">" 颜色语法生效</span><br /><span style="font-family: Arial; font-size: 10pt; color: #000000; background-color: #ffffff;">syntax on</span><br /><span style="font-family: Arial; font-size: 10pt; color: #000000; background-color: #ffffff;">" 根据文档类型，自动安排缩进，比如对待.c文件和对待makefile会有不同的缩进</span></div><div><span style="font-family: Arial; font-size: 10pt; color: #000000; background-color: #ffffff;">filetype indent on</span><br /><span style="font-size: 10pt; font-family: Arial; color: #000000; background-color: #ffffff;">" 文件编码（without bom）：</span><br style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px;" /><span style="font-size: 10pt; font-family: Arial; color: #000000; background-color: #ffffff;">set nobomb<br /></span>" 内部编码<br />set encoding=utf-8<br /><span style="font-family: Arial; background-color: #ffffff; font-size: 10pt; color: #000000;">" 文件编码utf-8</span><br style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; background-color: #ffffff;" /><span style="color: #000000; font-family: Arial; font-variant-ligatures: common-ligatures; text-align: -webkit-center; background-color: #ffffff; font-size: 10pt;">set fileencoding=utf-8<br />" 编码列表<br /></span><div><span style="color: #333333; font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14px;">set&nbsp;fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1</span></div></div><span style="color: #333333; font-family: Georgia, &quot;Bitstream Charter&quot;, serif; font-size: 16px;"><br /></span></div><span style="font-size: 12pt; font-family: Arial; background-color: #ffffff;"> </span><img src ="http://www.cppblog.com/hkingSP/aggbug/216279.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hkingSP/" target="_blank">宋鹏</a> 2019-03-03 10:54 <a href="http://www.cppblog.com/hkingSP/archive/2019/03/03/216279.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Vim 文件编码查看/修改</title><link>http://www.cppblog.com/hkingSP/archive/2019/03/03/216278.html</link><dc:creator>宋鹏</dc:creator><author>宋鹏</author><pubDate>Sun, 03 Mar 2019 01:55:00 GMT</pubDate><guid>http://www.cppblog.com/hkingSP/archive/2019/03/03/216278.html</guid><wfw:comment>http://www.cppblog.com/hkingSP/comments/216278.html</wfw:comment><comments>http://www.cppblog.com/hkingSP/archive/2019/03/03/216278.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/hkingSP/comments/commentRss/216278.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/hkingSP/services/trackbacks/216278.html</trackback:ping><description><![CDATA[<span style="font-size: 10pt;">Vim 文件编码查看：</span><br /><span style="font-size: 10pt;">:set fileencoding</span><br /><br /><span style="font-size: 10pt;">Vim 文件编码修改：</span><br /><span style="color: #4f4f4f; font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-variant-ligatures: common-ligatures; text-align: -webkit-center; background-color: #ffffff; font-size: 10pt;">:set fileencoding=utf-8<br /></span><br /><span style="font-size: 10pt;">Vim 文件编码修改（without bom）：</span><br /><span style="font-size: 10pt;">:set nobomb</span><br /><span style="color: #4f4f4f; font-family: -apple-system, &quot;SF UI Text&quot;, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, &quot;WenQuanYi Micro Hei&quot;, sans-serif; font-variant-ligatures: common-ligatures; text-align: -webkit-center; background-color: #ffffff; font-size: 10pt;">:set fileencoding=utf-8&nbsp; or :wq</span><br /><br /><span style="font-size: 10pt;">Terminal中文件编码查看：</span><br /><span style="font-size: 10pt;">file name.cpp </span><img src ="http://www.cppblog.com/hkingSP/aggbug/216278.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hkingSP/" target="_blank">宋鹏</a> 2019-03-03 09:55 <a href="http://www.cppblog.com/hkingSP/archive/2019/03/03/216278.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Vim 多文件编辑 切换</title><link>http://www.cppblog.com/hkingSP/archive/2019/02/28/216272.html</link><dc:creator>宋鹏</dc:creator><author>宋鹏</author><pubDate>Thu, 28 Feb 2019 05:58:00 GMT</pubDate><guid>http://www.cppblog.com/hkingSP/archive/2019/02/28/216272.html</guid><wfw:comment>http://www.cppblog.com/hkingSP/comments/216272.html</wfw:comment><comments>http://www.cppblog.com/hkingSP/archive/2019/02/28/216272.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/hkingSP/comments/commentRss/216272.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/hkingSP/services/trackbacks/216272.html</trackback:ping><description><![CDATA[<strong style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">多文件编辑（多个源码文件编辑）</strong><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">：</span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">1、打开第一个源码：</span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">在命令行中输入</span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">vi drivers/nand_legacy/nand_legacy.c</span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">vi就打开了nand_legacy.c文件。。</span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">2、打开第二个源码：</span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">在此基础上，在vi编辑界面，命令模式下：</span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">输入：sp common/env_nand.c</span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">就可以再多打开一个源码。。</span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">Tim：</span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">文件夹符号一定要用" / "</span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">3、在文件间切换：</span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">（1）</span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">Ctrl + w</span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">然后上下键选择。。</span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">（2）</span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">Ctrl + w + w</span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">按两次w切换过去。。</span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><img src ="http://www.cppblog.com/hkingSP/aggbug/216272.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hkingSP/" target="_blank">宋鹏</a> 2019-02-28 13:58 <a href="http://www.cppblog.com/hkingSP/archive/2019/02/28/216272.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Vim 搜索 替换 撤销</title><link>http://www.cppblog.com/hkingSP/archive/2019/02/28/216271.html</link><dc:creator>宋鹏</dc:creator><author>宋鹏</author><pubDate>Thu, 28 Feb 2019 05:58:00 GMT</pubDate><guid>http://www.cppblog.com/hkingSP/archive/2019/02/28/216271.html</guid><wfw:comment>http://www.cppblog.com/hkingSP/comments/216271.html</wfw:comment><comments>http://www.cppblog.com/hkingSP/archive/2019/02/28/216271.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/hkingSP/comments/commentRss/216271.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/hkingSP/services/trackbacks/216271.html</trackback:ping><description><![CDATA[<strong style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">6-1、搜索字符串</strong><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">：</span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">（1）命令模式下输入：</span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">/字符串</span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">例如" /Section 3 "。</span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">（2）如果查找下一个:</span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">按&#8220;n&#8221;即可。<br /></span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;"><strong>6-2、替换字符串：</strong></span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;"><strong>（1）替换光标所在的 当前行的第一个文本：</strong><br />例如：替换ELFIN_GPIO_BASE 为 S3C2410_GPIO_BASE：</span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">:s/ELFIN_GPIO_BASE/S3C2410_GPIO_BASE/<br /><strong>（2）替换光标所在的 当前行的所有文本：</strong>&nbsp;<br /></span><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">例如：替换 ELFIN_GPIO_BASE 为 S3C2410_GPIO_BASE：</span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">:s/ELFIN_GPIO_BASE/S3C2410_GPIO_BASE/g</span><br /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;"><strong>（3）全局替换：</strong></span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">:%s/ELFIN_GPIO_BASE/S3C2410_GPIO_BASE/g<br />说明：% 表示整个文件<br /></span><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;"><strong>（4）全局替换（带换行/回车）：</strong><br /></span>例如：把&#8220;空格MD5&#8221; 替换为 &#8220;回车MD5&#8221;，这里要用到转义，要先按下Ctrl + V，再按回车，就出现了转义后的文本<br />:%s/ MD5/^MMD5<span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;"><br /></span><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;"><strong>（5）全局替换（替换网址）：</strong></span><br /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">全局替换（将P1替换为P2）：</span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">:%s/p1/p2/g:</span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">替换实例：对/etc/apt/sources.list 中的网址进行替换，\要用/进行转义</span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">%s/us.archive.ubuntu.com\/ubuntu\//old-releases.ubuntu.com\/ubuntu\//g</span><br /><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><strong style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">7、撤销操作</strong><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">：</span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">按u</span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><span style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;">可以撤销上次的操作。。</span><br style="font-family: Tahoma; font-size: 11px; background-color: #ffffff;" /><img src ="http://www.cppblog.com/hkingSP/aggbug/216271.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hkingSP/" target="_blank">宋鹏</a> 2019-02-28 13:58 <a href="http://www.cppblog.com/hkingSP/archive/2019/02/28/216271.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Vim复制 粘贴 删除</title><link>http://www.cppblog.com/hkingSP/archive/2019/02/28/216270.html</link><dc:creator>宋鹏</dc:creator><author>宋鹏</author><pubDate>Thu, 28 Feb 2019 05:56:00 GMT</pubDate><guid>http://www.cppblog.com/hkingSP/archive/2019/02/28/216270.html</guid><wfw:comment>http://www.cppblog.com/hkingSP/comments/216270.html</wfw:comment><comments>http://www.cppblog.com/hkingSP/archive/2019/02/28/216270.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/hkingSP/comments/commentRss/216270.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/hkingSP/services/trackbacks/216270.html</trackback:ping><description><![CDATA[<p><strong>VI编辑器</strong>：<br /><strong>1、复制一行</strong>：<br />yy<br /><br /><strong>2、粘贴</strong>：<br />p<br /><br /><strong>3、删除一行</strong>：<br />dd<br /><br /><strong>4、全部删除</strong>：<br />dG（在命令模式下）<br /><br /><strong>5、多行复制、剪切、粘贴</strong>：<br />（1）、选择内容：<br />按v（在命令模式下按v）<br />切换到可视模式了，按方向键，知道选中你想要的内容<br />（2）、复制、剪切内容：<br />&#9312;按y，复制<br />&#9313;按d，剪切<br />&#9314;、粘贴内容：<br />将光标移到你要粘贴的位置。<br />按p<br />就粘贴了之前复制、剪切的内容。<br /><br /></p><img src ="http://www.cppblog.com/hkingSP/aggbug/216270.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hkingSP/" target="_blank">宋鹏</a> 2019-02-28 13:56 <a href="http://www.cppblog.com/hkingSP/archive/2019/02/28/216270.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Vim基础/Vim模式切换</title><link>http://www.cppblog.com/hkingSP/archive/2019/02/28/216269.html</link><dc:creator>宋鹏</dc:creator><author>宋鹏</author><pubDate>Thu, 28 Feb 2019 05:55:00 GMT</pubDate><guid>http://www.cppblog.com/hkingSP/archive/2019/02/28/216269.html</guid><wfw:comment>http://www.cppblog.com/hkingSP/comments/216269.html</wfw:comment><comments>http://www.cppblog.com/hkingSP/archive/2019/02/28/216269.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/hkingSP/comments/commentRss/216269.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/hkingSP/services/trackbacks/216269.html</trackback:ping><description><![CDATA[<p><strong>VI编辑器_基础（打开、退出、切换）</strong>：<br />1、创建和编辑文件：<br />sudo vi  hello.cpp<br /><br />2、编辑模式：<br />2-1、按 i 进入编辑模式<br />2-2、按ESC 进入命令模式<br /><br />3、退出：<br />按  : 激活命令<br />:q退出<br />:wq保存退出<br /><br />4、显示行号<br />:set nu<br /><br /><strong>VI编辑器_模式</strong>：<br /><strong>1、模式切换</strong>：<br />ESC<br />进入命令模式<br />命令模式下：<br />o  换行<br />x 删除光标下的输入<br />dd 删除一行<br />hjkl 可以上下左右移动<br /><br />：<br />进入末行模式<br />末行模式下：<br />q  退出<br /><br />i <br />进入编辑模式。。<br />Tim：模式切换都是先ESC回到命令模式之后再进行。。<br /><br /></p><img src ="http://www.cppblog.com/hkingSP/aggbug/216269.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hkingSP/" target="_blank">宋鹏</a> 2019-02-28 13:55 <a href="http://www.cppblog.com/hkingSP/archive/2019/02/28/216269.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Linux 文件查看/文件路径查看</title><link>http://www.cppblog.com/hkingSP/archive/2019/02/26/216266.html</link><dc:creator>宋鹏</dc:creator><author>宋鹏</author><pubDate>Tue, 26 Feb 2019 13:00:00 GMT</pubDate><guid>http://www.cppblog.com/hkingSP/archive/2019/02/26/216266.html</guid><wfw:comment>http://www.cppblog.com/hkingSP/comments/216266.html</wfw:comment><comments>http://www.cppblog.com/hkingSP/archive/2019/02/26/216266.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/hkingSP/comments/commentRss/216266.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/hkingSP/services/trackbacks/216266.html</trackback:ping><description><![CDATA[<strong designtimesp="10615">文件查看</strong>：<br />ls&nbsp;<br /><br /><strong>查看隐藏文件(比如 .git 这种entry文件，必须查看隐藏，才能看到)</strong>：<br />ls -a<br />非终端查看隐藏文件：<br />Ctrl + H<br /><br designtimesp="10618" /><strong>查看文件详细信息</strong>：<br designtimesp="10619" />ls -al<br /><br /><strong>查看和复制当前所在文件夹的完整路径：</strong><br />终端中：<br />pwd<br />非终端中：<br />Ctrl + l<br /><img src ="http://www.cppblog.com/hkingSP/aggbug/216266.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hkingSP/" target="_blank">宋鹏</a> 2019-02-26 21:00 <a href="http://www.cppblog.com/hkingSP/archive/2019/02/26/216266.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Linux 权限（Terminal权限/文件权限）</title><link>http://www.cppblog.com/hkingSP/archive/2019/02/26/216265.html</link><dc:creator>宋鹏</dc:creator><author>宋鹏</author><pubDate>Tue, 26 Feb 2019 13:00:00 GMT</pubDate><guid>http://www.cppblog.com/hkingSP/archive/2019/02/26/216265.html</guid><wfw:comment>http://www.cppblog.com/hkingSP/comments/216265.html</wfw:comment><comments>http://www.cppblog.com/hkingSP/archive/2019/02/26/216265.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/hkingSP/comments/commentRss/216265.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/hkingSP/services/trackbacks/216265.html</trackback:ping><description><![CDATA[<strong designtimesp="10605">基础</strong>：<br designtimesp="10607" />1、获得系统管理员权限：<br designtimesp="10608" />su<br designtimesp="10609" /><br designtimesp="10610" />2、虚拟机安装后，设置root权限：<br designtimesp="10611" />sudo passwd  root<br designtimesp="10612" />然后设置root密码。。<br designtimesp="10620" /><br designtimesp="10621" /><strong designtimesp="10622">源码权限变更</strong>：<br designtimesp="10624" />chmod 666 /Work/uboot/gec2410/*<br designtimesp="10625" />Tim：让gec2410文件夹，拥有读写权限。。<br designtimesp="10626" /><strong designtimesp="10627">源码权限查看</strong>：<br designtimesp="10629" />ls -lh  /Work/uboot/gec2410/<img src ="http://www.cppblog.com/hkingSP/aggbug/216265.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hkingSP/" target="_blank">宋鹏</a> 2019-02-26 21:00 <a href="http://www.cppblog.com/hkingSP/archive/2019/02/26/216265.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Linux 解压缩</title><link>http://www.cppblog.com/hkingSP/archive/2019/02/26/216264.html</link><dc:creator>宋鹏</dc:creator><author>宋鹏</author><pubDate>Tue, 26 Feb 2019 12:58:00 GMT</pubDate><guid>http://www.cppblog.com/hkingSP/archive/2019/02/26/216264.html</guid><wfw:comment>http://www.cppblog.com/hkingSP/comments/216264.html</wfw:comment><comments>http://www.cppblog.com/hkingSP/archive/2019/02/26/216264.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/hkingSP/comments/commentRss/216264.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/hkingSP/services/trackbacks/216264.html</trackback:ping><description><![CDATA[<p designtimesp="10602"><strong designtimesp="10632">解压缩</strong>：<br designtimesp="10634" />.tar <br designtimesp="10635" />解包：tar xvf FileName.tar<br designtimesp="10636" />打包：tar cvf  FileName.tar DirName<br designtimesp="10637" />（注：tar是打包，不是压缩！）<br designtimesp="10638" />&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br designtimesp="10639" />.gz<br designtimesp="10640" />解压1：gunzip FileName.gz<br designtimesp="10641" />解压2：gzip -d  FileName.gz<br designtimesp="10642" />压缩：gzip FileName</p> <p designtimesp="10643">.tar.gz 和 .tgz<br designtimesp="10644" />解压：tar zxvf  FileName.tar.gz<br designtimesp="10645" />压缩：tar zcvf FileName.tar.gz DirName<br designtimesp="10646" />&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br designtimesp="10647" />.bz2<br designtimesp="10648" />解压1：bzip2 -d FileName.bz2<br designtimesp="10649" />解压2：bunzip2 FileName.bz2<br designtimesp="10650" />压缩： bzip2  -z FileName</p> <p designtimesp="10651">.tar.bz2<br designtimesp="10652" />解压：tar jxvf  FileName.tar.bz2<br designtimesp="10653" />压缩：tar jcvf FileName.tar.bz2 DirName<br designtimesp="10654" /><br designtimesp="10655" />运行程序：<br designtimesp="10656" />有可执行文件hello，但是不能直接输入命令&#8216;hello&#8217;来运行hello，必须输入命令&#8216;./hello&#8217;</p><img src ="http://www.cppblog.com/hkingSP/aggbug/216264.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hkingSP/" target="_blank">宋鹏</a> 2019-02-26 20:58 <a href="http://www.cppblog.com/hkingSP/archive/2019/02/26/216264.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Linux 文件/文件夹操作</title><link>http://www.cppblog.com/hkingSP/archive/2019/02/26/216263.html</link><dc:creator>宋鹏</dc:creator><author>宋鹏</author><pubDate>Tue, 26 Feb 2019 12:58:00 GMT</pubDate><guid>http://www.cppblog.com/hkingSP/archive/2019/02/26/216263.html</guid><wfw:comment>http://www.cppblog.com/hkingSP/comments/216263.html</wfw:comment><comments>http://www.cppblog.com/hkingSP/archive/2019/02/26/216263.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/hkingSP/comments/commentRss/216263.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/hkingSP/services/trackbacks/216263.html</trackback:ping><description><![CDATA[<strong>创建文件夹</strong>：<br />mkdir  ./newfolder<br /><br /><strong>删除文件夹</strong>：<br />rm -rf  /Work/uboot/uboot-1.3.4<br /><br /><strong>重命名文件夹</strong>（跟移动一个命令）：<br />mv cpu/arm920t/ 0_BackUp<br /><br /><strong>重命名文件</strong>（跟移动一个命令）：<br />mv a.txt b.txt<br /><br /><strong>创建一个空文件</strong>：<br />touch .gitignore<img src ="http://www.cppblog.com/hkingSP/aggbug/216263.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hkingSP/" target="_blank">宋鹏</a> 2019-02-26 20:58 <a href="http://www.cppblog.com/hkingSP/archive/2019/02/26/216263.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Linux 文件搜索</title><link>http://www.cppblog.com/hkingSP/archive/2019/02/26/216262.html</link><dc:creator>宋鹏</dc:creator><author>宋鹏</author><pubDate>Tue, 26 Feb 2019 12:53:00 GMT</pubDate><guid>http://www.cppblog.com/hkingSP/archive/2019/02/26/216262.html</guid><wfw:comment>http://www.cppblog.com/hkingSP/comments/216262.html</wfw:comment><comments>http://www.cppblog.com/hkingSP/archive/2019/02/26/216262.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/hkingSP/comments/commentRss/216262.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/hkingSP/services/trackbacks/216262.html</trackback:ping><description><![CDATA[<strong>文件搜索</strong>：<br />find<br />格式：<br />$ find  &lt;指定目录&gt; &lt;指定条件&gt; &lt;指定动作&gt;<br />　　- &lt;指定目录&gt;：  所要搜索的目录及其所有子目录。默认为当前目录。<br />　　- &lt;指定条件&gt;： 所要搜索的文件的特征。<br />　　- &lt;指定动作&gt;：  对搜索结果进行特定的处理。<br />实例1：<br />find  board*<br />Tim：在uboot文件夹下，找下，看看board文件夹在不在。。<br />find  board/sm*<br />Tim：在uboot文件夹下，找下，看看smdk2410文件夹，是否在board下面。。<br />实例2：<br />（1）find .  -name  'my*'<br />Tim：<br />"."，表示指定搜索当前目录（含子目录）。。<br />"-name"，表示搜索条件是文件名。。<br />'my*'，表示my开头的文件。。<br />（2）find  . -name 'my*' -ls<br />"."表示指定搜索当前目录（含子目录）。。<br />"-name"，表示搜索条件是文件名。。<br />'my*'  -ls，表示搜索my开头的文件，并显示它们的详细信息。。<br />实例3：<br />find . -type f -mmin  -10<br />"."表示指定搜索当前目录（含子目录）。。<br />"-type f" 表示搜索条件是文件类型。。<br />-mmin  -10，表示搜索所有过去10分钟中更新过的普通文件。<br />如果不加-type  f参数，则搜索普通文件+特殊文件+目录。<br /><br /><strong>文件数据库搜索</strong>  ：<br />locate<br />locate不搜索具体目录，而是搜索一个数据库（/var/lib/locatedb），比find快的多。。<br />Tim：<br />执行前，要执行updatedb命令，更新数据库。。<br />实例1：<br />locate  /etc/sh<br />搜索etc目录下所有以sh开头的文件。<br />实例2：<br />（1）locate  ~/m<br />搜索用户主目录下，所有以m开头的文件。<br />（2）locate -i  ~/m<br />搜索用户主目录下，所有以m开头的文件，并且忽略大小写。<img src ="http://www.cppblog.com/hkingSP/aggbug/216262.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hkingSP/" target="_blank">宋鹏</a> 2019-02-26 20:53 <a href="http://www.cppblog.com/hkingSP/archive/2019/02/26/216262.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>