Answers for "bash command file path"

1

bash get path from filename

# Basic syntax:
dirname /full/file/name.txt

# Example usage:
dirname /full/file/name.txt
--> /full/file

# Note, if you want just the file name, use basename, e.g.:
basename /full/file/name.txt
--> name.txt
Posted by: Guest on June-26-2021
0

bash get path of script

SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
Posted by: Guest on January-18-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language