I use an environment variable $DATAPATH that conveniently takes me to where I store my data. Idk what I did just now but I created a folder in my home directory called '$DATAPATH', and when I cd into it, it takes me to the where my $DATAPATH is. It's like this directory is a shortcut to my actual $DATAPATH folder.

When I run file on it, it says the directory is a setgid directory. I'm not sure what that means.

How can I safely remove the shortcut $DATAPATH folder in my home directory, without actually removing anything in my $DATAPATH? The things I store in it are too big to cp/mv around.

  • "when I cd into it, it takes me to the where my $DATAPATH is." No it doesn't. You're just not escaping properly. – Joseph Sible-Reinstate Monica Oct 10 '19 at 1:11

It seems you created an ordinary symbolic link and you ran file $DATAPATH without single quotes on the folder and not on the symlink which would have given you something like

$ file '$DATAPATH'
$DATAPATH: symbolic link to /path/to/xyz

You can delete the symlink with

rm -i '$DATAPATH'

which you will have to confirm with y Enter.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.