Return the base path or file name from a full path

Given the full path:

/usr/local/bin/foo

Return the file name:

[email protected]:~ $ basename /usr/local/bin/foo
foo

Return the directory path:

[email protected]:~ $ dirname /usr/local/bin/foo
/usr/local/bin

comments powered by Disqus