Skip to content

Instantly share code, notes, and snippets.

@harry830622
Last active January 13, 2020 08:39
Show Gist options
  • Select an option

  • Save harry830622/28420caa755fd045522953b167b5953e to your computer and use it in GitHub Desktop.

Select an option

Save harry830622/28420caa755fd045522953b167b5953e to your computer and use it in GitHub Desktop.
Convert relative paths to absolute paths
#!/bin/env bash
rel_path=../relative/path
cd /path/to/here
abs_path=$(readlink -f $rel_path)
echo $abs_path # /path/to/relative/path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment