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 two editing areas, one above the other.
- -batch Execute in batch mode.
- -f
Execute a Slang function. - -g
Move to the specified line number in the buffer. - -i
Load the specified file into the buffer. - -n Do not load the jed.rc configuration file.
- -s
Search for and move to the specified string.
Example
jed is mainly used to edit program source code; when editing source code, it displays the program's syntax with color highlighting. For example, to edit a C source code file with jed, you can use the following command:
jed main.c #用jed编辑器打开main.c 文件
The output is as follows:
F10 key ==> File Edit Mode Search Buffers Windows System Help #编辑器菜单
/*-*- linux-c-*-*/ #Edit Area
#include
#include
#include
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 version number, current is simulating emacs editor, filename of the opened file, current time
loading /usr/share/jed/lib/modeinfo.slc
Linux Command Reference