sed去除行首空格

行首空格删除
sed -r 's/^s+//g' 514.txt
sed -e 's/^s*//g' 514.txt
sed 's/^ *//' 514.txt
sed 's/^[[:space:]]*//' 514.txt
awk '{sub(/^[ ]+/, "")};1' 514.txt
全部空格删除
sed '/^ .*/s/ //g' 514.txt

原文地址:https://www.cnblogs.com/lubing666666/p/4503187.html