I am trying to get mount points and their respective paths on linux. So when I run the mount -v
command I get this example output
//cifst/FSR on /mnt/share/cifst/FSR type cifs ...
//sydatsttbsq01/TheBooks statements to be parsed on /mnt/share/TheBooks type cifs ...
I am trying to parse this text to display this output
/mnt/share/cifst/FSR;//cifst/FSR
/mnt/share/TheBooks;//sydatsttbsq01/TheBooks
But the /mnt
on the first row is in column 3, while on the second row is in column 5 so how do I do this to get the /mnt
part
mount -v | grep mnt | awk '{ print $1'}
gets me the path but how do I get the mount points.