Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

2 Answers 2

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

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.