Let's say I have a string which represents the full path of a file:
full_path='./aa/bb/cc/tt.txt'
.
How can I extract only the file name tt.txt
?
Please don't tell me to use echo $full_path | cut -d'/' -f 5
.
Because the file may be located in a deeper or shallower folder.
The number, 5
, cannot be applied in all cases.