# If you want to edit the file in-placesed -i -e 's/^/prefix/' file# If you want to create a new filesed -e 's/^/prefix/' file > file.new
如果
prefix包含
/,则可以使用不在中的任何其他字符
prefix,或转义
/,因此
sed命令变为
's#^#/opt/workdir#'# or's/^//opt/workdir/'

# If you want to edit the file in-placesed -i -e 's/^/prefix/' file# If you want to create a new filesed -e 's/^/prefix/' file > file.new
如果
prefix包含
/,则可以使用不在中的任何其他字符
prefix,或转义
/,因此
sed命令变为
's#^#/opt/workdir#'# or's/^//opt/workdir/'