Any number of scripts can be written to perform this simple function. Because you only want a number, it is important to parse out any information other than that number. The first example follows: #Example1.sh grep c "." /etc/passwd Another example would be: #Example2.sh wc l /etc/passwd | cut d" " f1 |