Linux jed命令用于编辑文本文件。
Jed是以Slang所写成的程序,适合用来编辑程序原始代码。
语法
jed [-2n][-batch][-f<函数>][-g<行数>][-i<文件>][-I<文件>][-s<字符串>][文件]
参数:
-2 显示上下两个编辑区。
-batch 以批处理模式来执行。
-f<函数> 执行Slang函数。
-g<行数> 移到缓冲区中指定的行数。
-i<文件> 将指定的文件载入缓冲区。
-i<文件> 载入Slang原始代码文件。
-n 不要载入jed.rc配置文件。
-s<字符串> 查找并移到指定的字符串。
实例
jed主要用于编辑程序的源码,编辑源码时将以彩色高亮的方式显示程序的语法。例如使用jed编辑一个C语言的源代码文件,可使用如下命令:
jed main.c #用jed编辑器打开main.c 文件
输出结果如下:
F10 key ==> File Edit Mode Search Buffers Windows System Help #编辑器菜单
/*-*- linux-c-*-*/ #编辑区
#include <linux/mm.h>
#include <linux/sysctl.h>
#include <linux/nsproxy.h>
static struct list_head *
net_ctl_header_lookup(struct ctl_table_root *root, struct nsproxy *namespaces
.........................................................