Linux-nano编辑器.doc_第1页
Linux-nano编辑器.doc_第2页
Linux-nano编辑器.doc_第3页
Linux-nano编辑器.doc_第4页
Linux-nano编辑器.doc_第5页
已阅读5页,还剩1页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Linux nano文本编辑器被nano编辑器折腾了半天,收藏一下吧。省得以后到处找我们以后基本都需要编辑文件来实现不同的设置,那么我们用什么来设置配置文件呢,用编辑器,就好比windows下的记事本和写字板,我们今天就来讲一下debian的默认编辑器-nano首先我们在网络上看看有没nano的资料网络上很少有nano的资料,那么我就来 给大家讲解一下nano的使用吧就以编辑网络配置文件为例子吧GNU nano 1.2.4,nano的版本 File: /etc/network/interfaces打开的文件的绝对地址下面就是打开的文件的内容# This file describes the network interfaces available on your system# and how to activate them. For more information, see interfaces(5).# The loopback network interfaceauto loiface lo inet loopback# The primary network interfaceauto eth0iface eth0 inet staticaddress 192.168.254.20netmask 255.255.255.0network 192.168.254.0broadcast 192.168.254.255gateway 192.168.254.254# dns-* options are implemented by the resolvconf package, if installeddns-nameservers 202.103.0.117 202.103.24.68 Read 17 lines G Get Help O WriteOut R Read File Y Prev Page K Cut Text C Cur PosX Exit J Justify W Where Is V Next Page U UnCut Txt T To Spell这些是帮助栏目,呵呵G表示ctrl+g一起按,呵呵G Get Help表示同时按ctrl和G,就是调出帮助菜单我们来试一下我按了一下就调出了帮助菜单了,我下面就直接把快捷键表给大家,大家试试吧一直以来vi都被人们说是最强大的编辑器,但gentoo和debian选择nano做了默认的编辑器freebsd选择ee做了默认的编辑器,我相信在专业人士眼睛里面freebsd和redaht比较起来,redhat基本没什么可以炫耀的,为什么他们不选择vi呢,因为vi操作比较复杂而所谓的简单编辑器nano就简单,非常容易上手,说是简单编辑器其实一点都不简单,只不过是nano谦虚一下罢了这里声明一下表示键盘上的ctrl键,上个只要是做过编程的朋友应该都清楚,G表示同时按下ctrl和g(F1)表示按(F1)也是一样的 ,M-表示使用alt+后面的键G =F1) Invoke the help menu调用帮助菜单X =(F2) Close currently loaded file/Exit from nano退出O =(F3) Write the current file to disk = O WriteOut保存然后回车就保存了J =(F4) Justify the current paragraph调整当前段落(配置文件的不要用这东西,格式一下就出问题了哦)R =(F5) Insert another file into the current one插入其他的文件到当前的文件,而且查找文件的时候支持tabW =(F6) Search for text within the editor查找Y =(F7) Move to the previous screen上一屏幕V =(F8) Move to the next screen下一屏幕K =(F9) Cut the current line and store it in the cutbuffer裁减当前一排并保存在缓冲区U =(F10) Uncut from the cutbuffer into the current line将缓冲区的东西粘贴到此C =(F11) Show the position of the cursor显示光标位置T =(F12) Invoke the spell checker, if available调用拼写检查程序P Move up one line向上移动一行N Move down one line向下移动一F Move forward one character向前移动光标一格B Move back one character向后移动光标一格A Move to the beginning of the current line移动到当前行的开头E Move to the end of the current line移动到当前行的末尾L Refresh (redraw) the current screen刷新当前屏幕 (M-A) Mark text at the current cursor location标记文本D Delete the character under the cursor删除光标后一个字母H Delete the character to the left of the cursor向左边删一个字母I Insert a tab character插入一个tab值 (F14) (M-R) Replace text within the editor查找并且替换M Insert a carriage return at the cursor position插入一个回车_ (F13) (M-G) Go to a specific line number跳转到某行Space Move forward one word前进一个单词M-Space Move backward one word后退一个单词M- Find other bracket搜索下一个括号M- Open next loaded file打开下一个加载的文件M-C Constant cursor position enable/disableM-I Auto indent enable/disable是否首行缩进M-Z Suspend enable/disable是否悬挂M-X Help mode enable/disable帮助模式M-M Mouse support enable/disable鼠标支持M-Y Color syntax highlighting enable/disable语法加亮这个就是退出了哦好了nano 的编辑器就说这样多了然后我们来说一下基本的几个配置文件以及地方首先是打开命令行高效输入的位置看到了高级的命令行补全,连软件包的名字都不需要记了哦,呵呵,是不是很爽哦怎么ls没颜色了,你们是不是在redhat里面看到过颜色啊,那我们来改看到了没,兰色是目录,白色是文件,绿色是可以运行的文件cnrot:/# ll-bash: ll: command not found告诉我们ll没这个命令那我们来做一个自己定义的命令吧记住要注销才生效,不需要重新启动的哦看到了没看到了没,这是自己定义命令哦好了,我现在 给大家说几个文件的位置吧怕大家找不到首先是网络配置文件/etc/network/interfacesGNU nano 1.2.4 File: /etc/network/interfaces Modified# This file describes the network interfaces available on your system# and how to activate them. For more information, see interfaces(5).# The loopback network interfaceauto loiface lo inet loopback# The primary network interfaceauto eth0iface eth0 inet staticaddress 192.168.254.20netmask 255.255.255.0network 192.168.254.0broadcast 192.168.254.255gateway 192.168.254.254# dns-* options are implemented by the resolvconf package, if installeddns-nameservers 202.103.0.117 202.103.24.68安装源配置文件GNU nano 1.2.4 File: /etc/apt/sources.list#deb file:/cdrom/ sarge maindeb cdrom:Debian GNU/Linux 3.1 r0a _Sarge_ - Official i386 Binary-1 (20050

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论