Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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)
share|improve this question
up vote 3 down vote accepted

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


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.

share|improve this answer

Sorry, figured this out

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

share|improve this answer

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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