Bash: How to get the directory of the current file
27 October 2023 (Updated 27 October 2023)
current_dir=$(dirname "$0")
echo '--------------------------------------------------'
echo "The directory of the current file is $current_dir"
echo '-------------------------------------------------------'
Tagged:
Bash
Thanks for your comment 🙏. Once it's approved, it will appear here.
Leave a comment