nubme nubme - 1 year ago 145
Bash Question

Bash: retrieve absolute path given relative

Is there a command to retrieve the absolute path given the relative path?

For example I want $line to contain the absolute path of each file in dir


find ./ -type f | while read line; do
echo $line

Answer Source


find $(pwd)/ -type f

to get all files or

echo $(pwd)/$line

to display full path (if relative path matters to)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download