0

Following is a link to answer problem about how to find GCC include path.

Finding out what the GCC include path is

For the last answer, which is:

$ `gcc -print-prog-name=cc1` -v

I do not understand about the meaning of grave accent (`). Does anyone understand about its meaning?

Community
  • 1
  • 1
Timberjack30
  • 61
  • 1
  • 7

1 Answers1

0

The character "$" is just part of prompt. The command

gcc -print-prog-name=cc1

is returning something like:

/usr/lib/gcc/x86_64-linux-gnu/4.8/cc1

And now if you add the two characters ` at the beginning and end of command, output will be returned to your terminal, and you can use this as part of command. So, for example

cd /home/`whoami`

should bring you to your home folder. So, in your example, the command:

`gcc -print-prog-name=cc1` -v

is equal to:

/usr/lib/gcc/x86_64-linux-gnu/4.8/cc1 -v

which prints the version of cc1

melpomene
  • 84,125
  • 8
  • 85
  • 148
Mariusz
  • 349
  • 2
  • 7
  • 2
    The output isn't (necessarily) returned to the terminal. Rather, ` ``command`` ` is *replaced* by the output of `command`. And in most shells, you can use `$(command)`, which is a bit more legible and can be nested (and is a lot easier to render in Stack Overflow comments). – Keith Thompson Oct 21 '15 at 19:56