Linux jed命令
Linux jed命令用於編輯文本檔。
Jed是以Slang所寫成的程式,適合用來編輯程式原始代碼。
語法
jed [-2n][-batch][-f<函數>][-g<行數>][-i<檔>][-I<檔>][-s<字串>][檔]
參數:
- -2 顯示上下兩個編輯區。
- -batch 以批處理模式來執行。
- -f<函數> 執行Slang函數。
- -g<行數> 移到緩衝區中指定的行數。
- -i<檔> 將指定的檔載入緩衝區。
- -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)
{
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

Linux 命令大全