title: How to get the last part of dirname in Bash
body: <p>Suppose I have a file <code>/from/here/to/there.txt</code>, and want to get only the last part of its dirname <code>to</code> instead of <code>/from/here/to</code>, what should I do?</p>