空格去除
1、行首
cat file |sed ‘s^/[ \t]*//g‘
2、行尾
cat file | sed ‘s/[ \t]*$//g‘
3、所有空格
cat file | sed s/[[:space:]]//g
去除空行
cat file | tr -s ‘\n‘
cat file | grep -v "^$"
awk删除第一行
1.采用awk
awk ‘{$1="";print $0}‘ file
2.采用sed
sed -e ‘s/[^ ]* //‘ file
原文:https://www.cnblogs.com/niwajiang1/p/14425759.html