write different between dd and 2dd command
Answers
Answer:
bs= sets the blocksize, for example bs=1M would be 1MiB blocksize. count= copies only this number of blocks (the default is for dd to keep going forever or until the input runs out). ... seek= seeks this number of blocks in the output, instead of writing to the very beginning of the output device.
Explanation:
There are some commands that are only in visual mode, and some commands only in ex mode; but there are some commands in both. Deleting a line is in both.
In visual mode, you make up a command with three possible parts: a count, a command, and what the command should operate upon. The basic delete command is d, and you can combine it with movement commands: move to next word is w, delete to next word is dw; move to next paragraph is }, delete to next paragraph is d} and so on. As a special shortcut, dd deletes a line. You can delete three lines with 3dd. But note that there are many, many ways to delete part of a line.
In ex mode, the delete command can only operate on whole lines. You can prefix the delete command with line numbers to delete a range of lines: :1,10d<Enter> would delete lines 1 through 10. You can mark a line with mark b and mark another line with mark e and then delete from the one to the other like so: :'b,'ed<Enter> And you can delete the current three lines by following dwith a count: :d3<Enter>
In ex mode, to operate within a line you need to use the s command (substitute). To change hamburger to hot dog you would use: :s/hamburger/hot dog/<Enter>
In a sense, ex mode came first. The first editor was called ed and ex was a super-set of the features of ed, and then added visual editing.
With :d, you can add an integer after it to specify how many lines to delete. With dd, you delete one line only.
For example, using :d3 will delete three lines; of course, if you just use :d with no number following it, there is no difference.
EDIT: Thanks to steveha and BenjaminRH for clarifying below - it turns out you can delete using dd by using a number before it. You can also repeat dd by using a ..