4

What is "link to executable" ? I'm trying to understand what "gcc" is. If I open Properties of it in Unity UI it says "link to executable".

I googled it. Tried following commands

link readlink ln

I'm confused. What command I should use in order to:

  • check whether file is link or not
  • view where link points to
  • change destination of a link (I need to repoint gcc to gcc 4.7 in my case)

3 Answers 3

7

Yes, it is a symbolic link, created with the ln command. To replace the link, you need to do

sudo ln -sf /usr/bin/gcc-4.7 /usr/bin/gcc

or

sudo ln -sf `which gcc` `which gcc-4.7`

The -s is for symbolic (otherwise you will get a "hard link"), -f is for "force", because the target already exists.

I assume that you do have gcc-4.7 installed, and that there is a binary in /usr/bin called "gcc-4.7". Ootherwise you will only break your existing link.

1

Sorry, figured this out

sudo ln -sfn /usr/bin/gcc-4.7 /usr/bin/gcc

1
  • What's the significance of n? Sep 14, 2023 at 19:06
0

Didn't work for me while i was inside the same folder

User@COMPUTER:/opt/Prepros-linux-64$ sudo ln -s Prepros /usr/bin/prepros

Didn't work

User@COMPUTER:~$ sudo ln -s /opt/Prepros-linux-64/Prepros /usr/bin/prepros

It worked

I hope it helps someone else.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .