English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The Linux ed command is a text editor used for text editing.
ed is the simplest text editing program in Linux, which can only edit one line at a time rather than full-screen operations.
The ed command is not a commonly used command, generally more commonly used is the vi instruction. But the ed text editor is very useful for editing large files or for text editing in shell script programs.
ed [-][-Gs][-p<string>][--help][--version][file]
Parameters:
-G or --traditional Provide backward compatible features.
-p<string> Specify the prompt character for ed in command mode.
-s,-,--quiet or --silent Do not execute the check function when opening a file.
--help Display help.
--version Display version information.
The following is a complete example of the Linux ed command interpretation:
$ ed <- activate the ed command a <- tell ed I want to edit a new file My name is Titan. <- إدخال محتوى السطر الأول And I love Perl very much. <- إدخال محتوى السطر الثاني . <- العودة إلى حالة سطر الأوامر لمحرر ed i <- إخبار ed أنني أريد إدراج محتوى بين الأعمدة I am 24. <- إدراج “I am 24.” بين “My name is Titan.” و“And I love Perl very much.” . <- العودة إلى حالة سطر الأوامر لمحرر ed c <- إخبار ed أنني أريد استبدال آخر سطر تم إدخاله I am 24 years old. <- استبدال “I am 24.” بـ “I am 24 years old.” (ملاحظة: يتم استبدال الأخير الذي تم إدخاله) . <- العودة إلى حالة سطر الأوامر لمحرر ed w readme.text <- اعطاء اسم لملف “readme.text” وتخزينه (ملاحظة: إذا كنت تعمل على ملف موجود بالفعل، يكفي أن تدخل w فقط) q <- الخروج بشكل كامل من محرر ed
هذا هو محتوى الملف هو:
$ cat readme.text اسمي Titan أنا في ال24 من عمري واحب Perl جدًا