You can use Linux readlink command to get the absolute (full) path of a file in Linux.
Example:
Create a new file and directory in your home directory:
1 2 3 4 5 6 |
## move to your home directory cd ## craete a file inside multiple directory mkdir -p mydir1/mydir2/mydir3 echo "hello world" > mydir1/mydir2/mydir3/myfile.txt |
Get the absolute (full) path of the file:
1 2 3 4 5 6 7 |
## Get the absolute (full) path of a file ## readlink -f readlink -f mydir1/mydir2/mydir3/myfile.txt ## returns the absolute (full) path of the file rm -rf my* |