How to add a folder to the path


I have some ascii data files in a folder on an external hard drive. Is there a way to add a directory to the path, rather than copying all my data into $HOME/.gmt/cache. When I put my files in the cache folder, then GMT is able to access them, but not otherwise.

I’ve tried adding

$GMT_DATADIR = filepath

but it doesn’t work. What is the best way to add directories for GMT to have access?


Depends on your shell. If you are using bash you would say

export GMT_DATADIR=yourpath

If csh/tcsh then it is

setenv GMT_DATADIR yourpath

1 Like

(Using a bash shell.) Hmmm, interesting…

export GMT_DATADIR=yourpath

does NOT work. However,

export GMT_CACHEDIR=yourpath

DOES work. For reference, the ascii data is accessed using ‘gmt plot @data.txt’. Not sure why the first one does not work. Thanks for your help, Paul.

OK, well the @ is only for data we distribute and you don’t want to use GMT_CACHEDIR for this as you loose ability to use our remote cache data. Do the GMT_DATADIR and yank the @ sign.

1 Like

Ahh, thanks for the clarification. I removed the @ and changed back to GMT_DATADIR.