复制/etc/profile至/tmp/目录[root@Contos7 tmp]#cp /etc/profile /tmp删除/tmp/profile文件中的空白行用查找替换命令删除/tmp/profile文件中的行首的空白字符sed 's@^[[:space:]]+@@' profile执行前:执行后:[root@Contos7 tmp]#sed 's@^[[space:]]\+@@' profile
[root@Contos7 tmp]#cp /etc/profile /tmp
[root@Contos7 tmp]#sed 's@^[[space:]]\+@@' profile