Latest web development tutorials

Linux jed命令

Linux 命令大全 Linux命令大全

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)  
{  
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 命令大全 Linux命令大全