-4

I'm working on my university server and trying to find the location of /gnu. I know that it is installed with the latest version as I get the correct version using:g++ --version

On using find find gnu it return no result. How can I find the path to gnu?

Anthon
  • 79,293
P R
  • 93

2 Answers2

2

There normally isn't a command or file called gnu.

The name gnu refers to the GNU Project, and includes a number of distinct programs, including gcc, emacs, the Bash shell, the Coreutils suite (which includs commands like rm, cp, mv, and so forth), and a number of other things. The goal of the project is/was to create an entire operating system.

On some systems, GNU tools might be installed in a special directory, perhaps /opt/gnu or /gnu. On others, including most Linux-based (or "GNU/Linux") systems, the GNU tools make up a large part of the operating system.

There is no "current version" of GNU; each sub-project (gcc, coreutils, emacs, ...) has its own series of releases.

Incidentally, your question asks about the location of /gnu. /gnu, if it exists, is a location. And find gnu is going to (attempt to) traverse the gnu directory in your current directory. I suggest you need to study the workings of Unix-like file systems.

0

which - shows the full path of (shell) commands.

~> which g++
/usr/bin/g++

find - search for files in a directory hierarchy

find / | grep gnu (for example)

maniat1k
  • 1,505
  • Only use which in csh or tcsh shells (will also work in zsh). Use type in Bourne-like shells. – Stéphane Chazelas May 31 '13 at 15:07
  • @StephaneChazelas why? which is /usr/bin/which on my system, so it works anywhere. At least as long as PATH is exported, which it normally is... (besides, you'd use command -v, which gives the same output as which would. ) – derobert May 31 '13 at 15:19
  • @derobert, it's a bit of a FAQ here, see here, here and here. which is a broken non-standard work around for shells that don't have an equivalent builtin. command -v is fine but less useful when commands are aliased or defined as functions. – Stéphane Chazelas May 31 '13 at 16:48
  • 1
    find / is likely to take a very long time to run, especially if the system has network-mounted file systems; it's also going to give you a whole lot of error messages for directories you don't have permission to read or traverse. – Keith Thompson May 31 '13 at 18:34