I have file with below contents .
/ABC/RTE/AD_900_VOP_123/OPP
/ABC/RTE/TRE/AD_900_VOP_145/BBB
/ABC/RTE/AN_900_VFP_124/FBF
/ABC/RTE/HD_900_FOP_153/WEW
/ABD/RDV/AD_900_VOP_123/OPP
/ABC/RTE/WD_900_VOP_123/GRR/TRD
/ABC/RTE/RTD/AR_900_VOP_443/SDD
How can I use regular expression on this file such that I get the output such as
AD_900_VOP_123
AD_900_VOP_145
AN_900_VFP_124
HD_900_FOP_153
AD_900_VOP_123
WD_900_VOP_123
AR_900_VOP_443
<alphabets>_<digits>_<alphabets>_<digits>
and fall between two/
– g4ur4v Jun 25 '13 at 16:26awk -F/ '{print $(NF-1)}'
to find last dir (if those are dirs) – JJoao Jan 13 at 12:01