Linux jed command
The Linux jed command is used to edit text files.
Jed is a program written in Slang, suitable for editing program source code.
Syntax
jed [-2n][-batch][-f<函数>][-g<行数>][-i<文件>][-I<文件>][-s<字符串>][文件]
Parameters:
- -2 Display the upper and lower editing areas.
- -batch Execute in batch mode.
- -f<function> Execute a Slang function.
- -g<line number> Move to the specified line number in the buffer.
- -i<file> Load the specified file into the buffer.
- -n Do not load the jed.rc configuration file.
- -s<string> Find and move to the specified string.
Examples
jed is mainly used to edit program source code. When editing source code, it displays the program syntax with color highlighting. For example, to use jed to edit a C language source code file, you can use the following command:
jed main.c #用jed编辑器打开main.c 文件
The output result is as follows:
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)
{
return &namespaces->net_ns->sysctl_table_headers;
}
static struct ctl_table_root net_sysctl_root = {
.lookup = net_ctl_header_lookup,
};
static int sysctl_net_init(struct net *net)
{
INIT_LIST_HEAD(&net->sysctl_table_headers);
return 0;
}
-----+(Jed 0.99.18U) Emacs: main.c (C) All 6:06pm-----------------------------
#从左到右分别为jed版本编号、当前是模拟emacs编辑器、打开的文件名、现在的时间
loading /usr/share/jed/lib/modeinfo.slc
Other Extensions
Linux Command Encyclopedia