home tools

Get the Name of the Current Directory in bash

April 2026
#!/bin/bash

CURRENT_DIR_NAME=$(basename "$PWD")

echo $CURRENT_DIR_NAME
get-current-directory-name