Feb 052010
Remove directory name from file path
Answer:
It is easy to use basename to remove directory name from file path
E.g.
# basename /tmp/test.txt
test.txt
# basename /tmp/test.txt .txt
test
If you supply the 2nd argument, it will remove the characters if they exist in the suffix of the input filename.