Last active
October 27, 2021 12:50
-
-
Save exaucae/02aaf4a592a3d8b2597bca59446bb396 to your computer and use it in GitHub Desktop.
scripting utils
This file contains 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
Windows | |
======= | |
1. netstat -ano | findstr < Port Number > | |
Example: netstat -ano | findstr 8080 | |
2. taskkill /F /PID < Process Id > | |
Example: taskkill /F /PID 25392 |
This file contains 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
# dir of script | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"; | |
# parent dir | |
# or PARENT_DIRECTORY="${DIR%/*}" | |
PARENT_DIR="$(dirname "$(dirname "$(readlink -fm "$0")")")" | |
Ref: | |
- https://stackoverflow.com/questions/20196034/retrieve-parent-directory-of-script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment