Below is the grep command to use.
grep -o '/[^/]*$' <filename> | cut -c2-
For e.g. if contents of file is as follows:
/registry/pods/kube-system/kube-flannel-ds-abcde
/registry/pods/kube-system/kube-flannel-ds-xyzab
Above command will print below
kube-flannel-ds-abcde
kube-flannel-ds-xyzab
No comments:
Post a Comment