I am trying to use awk to get the name of a file given the absolute path to the file. For example, when given the input path /home/parent/child/filena
awk
/home/parent/child/filena
In this case it is better to use basename instead of awk:
basename
$ basename /home/parent/child1/child2/filename filename