-
-
Save georgekovachjr/54769f1fe05a8599cdadb6cdb174570d to your computer and use it in GitHub Desktop.
Bash test if directory is writable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # By path | |
| if [ -w "/path/to/dir" ]; then echo "WRITABLE"; else echo "NOT WRITABLE"; fi | |
| # Current dir | |
| if [ -w `pwd` ]; then echo "WRITABLE"; else echo "NOT WRITABLE"; fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment