Q:

How to look for all filesystem which start with /filesystem

When I do df -h I get following output
/dev/sda                       3.7T   34M  3.7T   1% /filesystem1
/dev/sdb                        3.7T   34M  3.7T   1% /filesystem2
/dev/sdc                        3.7T   34M  3.7T   1% /filesystem3

I am using following command to get this list but it is giving blank
df -h | grep ^filesystem
Please help to find correct command

A:

Your command looks for filesystem at the beginning of the line. There are two problems with that:

The string you're looking for begins with /filesystem, not filesystem; and
it's not at the beginning of the line, it's the last field in the line.

You can use awk and get the last field with $NF.
df -h | awk '$NF ~ /^\/filesystem/'

