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
Like 5 years late, I know, thanks for all the proposals, I used to do this the following way:
$ echo /home/parent/child1/child2/filename | rev | cut -d '/' -f1 | rev filename
Glad to notice there are better manners