z/OS UNIX System Services User's Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Moving text

z/OS UNIX System Services User's Guide
SA23-2279-00

The first step in moving a block of text is to select text for moving. In fact, you already know how to do this. The d command not only deletes a block of text, but also copies it to a paste buffer. Once in the paste buffer, the text can be moved by repositioning the cursor and then using the p command to place the text after the current cursor position.

To delete the first line of the file, move there and type:
dd
The line is deleted and copied into the paste buffer, and the cursor is moved to the next line in the file. To paste the line following the current line, type:
p
To paste text before the cursor rather than after it, use the P (uppercase) command.
If you delete a letter or word size block, it will be pasted into the new position within the current line. For example, to move the word came after the word spider, you could use the following command sequence:
/came <Enter>
dw
/spider <Enter>
p

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014