Find a replacement App example:
Copy/etc/profile to/tmp/directory, remove white space characters from the beginning of the/tmp/profile file with the Find replacement command
:%[email protected]^[[:space:]]\[email protected]@g
Copy the/etc/rc.d/init.d/functions file to the/tmp directory, and add a # number to the beginning of the line beginning with each line of/tmp/functions with the find replacement command.
:%[email protected]\(^[[:space:]]\+\)@#\[email protected]
Copy the/etc/rc.d/init.d/functions file to the/tmp directory, replacing the/etc/sysconfig/init in the/tmp/functions file with the/var/log
:%s/\/etc\/sysconfig\/init/\var\/log/g
- Delete the # number at the beginning of all lines in the/tmp/functions file that begin with # and that have at least one white space character after #
:%[email protected]\(^#[[:space:]]\+\)@\[email protected]
Vim Usage Tips