[Count empty lines]
grep '^$' /root/Desktop/chk_services.sh | wc -l
[Count lines which are not empty]
grep -v '^$' /root/Desktop/chk_services.sh | wc -l
[Count lines start with hash #]
grep '^#' /root/Desktop/chk_services.sh | wc -l
[Count lines which dont start with #]
grep -v '^#' /root/Desktop/chk_services.sh | wc -l
No comments:
Post a Comment