YouTip LogoYouTip

Linux Comm Ed

# Linux ed Command [![Image 3: Linux Command Manual](#) Linux Command Manual](#) The Linux ed command is a text editor used for text editing. ed is the simplest text editor in Linux, capable of editing only one line at a time rather than operating in a full-screen mode. The ed command is not a commonly used command; the vi command is generally used more frequently. However, the ed text editor is useful for editing large files or for text editing within shell script programs. ### Syntax ed **Parameters**: * -G or --traditional Provides backward-compatible functionality. * -p Specifies the prompt character for ed in command mode. * -s, -, --quiet, or --silent Does not perform the check function when opening a file. * --help Displays help. * --version Displays version information. ### Example Here is a complete example analysis of Linux ed: $ ed <- Activate the ed command a <- Tell ed I want to edit a new file My name is Titan. <- Enter the first line of content And I love Perl very much. <- Enter the second line of content . <- Return to ed's command line mode i <- Tell ed I want to insert content before the last line I am 24. <- Insert "I am 24." between "My name is Titan." and "And I love Perl very much." . <- Return to ed's command line mode c <- Tell ed I want to replace the last line of input I am 24 years old. <- Replace "I am 24." with "I am 24 years old." (Note: This replaces the last entered content) . <- Return to ed's command line mode w readme.text <- Name the file "readme.text" and save it (Note: If editing an existing file, you only need to type w) q <- Completely exit the ed editor The content of the file is: $ cat readme.text My name is Titan. I am 24 years old. And I love Perl vrey much. [![Image 4: Linux Command Manual](#) Linux Command Manual](#)
← Linux Comm EgrepLinux Comm Csplit β†’