hometools

Get the Name of the Current Directory in bash

April 2026
loop-through-files.bash
#!/bin/bash

CURRENT_DIR_NAME=$(basename "$PWD")

echo $CURRENT_DIR_NAME
get-current-directory-name