ED(1) General Commands Manual ED(1)NAME
ed - editor
- Suppress line/byte count messages (for in scripts)
ed prog.c # Edit prog.c
echo '1,$p' | ed - file
# Odd way to write 'cat file'
Ed is functionally equivalent to the standard V7 editor, ed. It supports the following commands:
(.) a: append
e: edit new file"
f: print name of edited file"
(1,$)g: global command
(.) i: insert
(.,.+1)j: join lines together
(.) k: mark
(.) l: print with special characters in octal
q: quit editor"
(.) r: read in new file
(1,$)v: like g, except select lines that do not match
(1,$)w: write out edited file
Many of the commands can take one or two addresses, as indicated above. The defaults are shown in parentheses. Thus a appends to the cur-
rent line, and g works on the whole file as default. The dot refers to the current line. Below is a sample editing session with comments
given following the # symbol.
ed prog.c # Edit prog.c
3,20p # Print lines 3 through 20
/whole/ # Find next occurence of whole
s/whole/while/ # Replace whole by while
g/Buf/s//BUF/g # Replace Buf by BUF everywhere
w # Write the file back
q # Exit the editor
Ed is provided for its sentimental value. If you want a line-oriented editor, try ex. If you want a good editor, use elle, elvis, or
SEE ALSO elvis(1), elle(9), mined(9).
Check Out this Related Man Page
vidir - edit directory
vidir [--verbose] [directory|file|-] ...
vidir allows editing of the contents of a directory in a text editor. If no directory is specified, the current directory is edited.
When editing a directory, each item in the directory will appear on its own numbered line. These numbers are how vidir keeps track of what
items are changed. Delete lines to remove files from the directory, or edit filenames to rename files. You can also switch pairs of numbers
to swap filenames.
Note that if "-" is specified as the directory to edit, it reads a list of filenames from stdin and displays those for editing.
Alternatively, a list of files can be specified on the command line.
OPTIONS -v, --verbose
Verbosely display the actions taken by the program.
find | vidir -
Edit subdirectory contents too. To delete subdirectories, delete all their contents and the subdirectory itself in the editor.
find -type f | vidir -
Edit all files under the current directory and subdirectories.
Editor to use.
Also supported to determine what editor to use.
Copyright 2006 by Joey Hess <email@example.com>
Licensed under the GNU GPL.
moreutils 2010-04-28 VIDIR(1)
sorry for this simple question.
I could not find information about it elsewhere.
well, I would like to yank some text from a file through the vi and write the yanked text into another file. how to do that?
:confused: (9 Replies)
Hello all... please help with the following.
I am parsing the following type of file...
Would like to make it look like this...
W098 (8 Replies)
I need to change the editor to vi in SUN OS. I need to use the options that vi gives while I am typing on the command line. I can vi any file and make changes to it. But my problem is when I am using the command line. Currently I cannot use the vi options while doing so. Hence, while I am typing a... (8 Replies)
I have a file which has only one colomn of numbers,ex:
What ksh / unix command should I use to create a file in which those numbers will be in one line,like this
122 173 292 400 979 .... etc
Thanks a lot for help (9 Replies)
I want to print lines from file using certain conditions
# The following commands will create a new control file and use it
# to open the database.
# The contents of online logs will be lost and all backups will
# be invalidated. Use this only if online logs are... (25 Replies)
If a file contains content of 2000 lines,
from which i need to remove the first n characters or first n spaces from each line of the file.
If suppose to remove n characters or first n spaces from a single line means, just use the command nx.
But from the above scenario,... (9 Replies)
I am writing most of my scripts in the vi editor (OS is AIX) at present. Just trying to see if any of you would recommend some graphical editor that supports syntax highlighting (the editor has to run on AIX).
I have to log in to the UNIX server from a PC (using Xming and Putty), so it has to be... (19 Replies)
I have been using shell scripts and other unix commands for my daily file and other operations onto the unix box.
I have never written C or any other programming lanugae, But now I want write programs in C, but I am not able to co-relate with the work,Can you please help me to undersntad... (8 Replies)
I need to search for a multiple line pattern and remove it
the pattern is search for
(ln number) <TABLE name=*>
and if 3 lines below that the line is
(ln number) </TABLE>
Then remove those 4 lines.
Thank you (14 Replies)
We have a huge file which has just one really large line; about 500 MB. I want to
1. Count all the occurrences of a phrase
2. Replace the phrase with another.
Trying to open it using vi has not helped as it complains that it is too large. Can any script help? Please advise.
Thank you, (12 Replies)
I have a bunch of random character lines like ABCEDFG. I want to find all lines with "A" and then change any "E" to "X" in the same line. ALL lines with "A" will have an "X" somewhere in it. I have tried sed awk and vi editor. I get close, not quite there. I know someone has already solved this... (10 Replies)
I have a file that I need to find each interface that has move-group on the interface line and print this line if the lines under the interface does Not have "filter-shared 14".
interface 1/1/1/0 move-group
decription one one one zero
filter-shared 14... (21 Replies)