方法:
sed -i "s/^#//g" ztj.txt
[root@logstash ~]# cat ztj.txt
#
/home1 ztj1
/home ztj
#
/home2 ztj2
#222
/home3 ztj3
/home4 ztj4
#afasdf
[root@logstash ~]# sed -i "s/^#//g" ztj.txt
[root@logstash ~]# cat ztj.txt
/home1 ztj1
/home ztj
/home2 ztj2
222
/home3 ztj3
/home4 ztj4
afasdf
[root@logstash ~]#