-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
  • 78,313
  • 42
  • 165
  • 222
P R
  • 93
  • What operating system is this? Post the output of `uname -a`. If this is Linux, what distribution? (Try `lsb_release -d`). What makes you think there is a `/gnu` anywhere? Why are you looking for it: [what are you trying to do](http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem)? – Gilles 'SO- stop being evil' May 31 '13 at 22:44

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.

Keith Thompson
  • 21,782
  • 6
  • 48
  • 55
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,495
  • 4
  • 25
  • 40
  • 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](http://unix.stackexchange.com/a/10529/22565), [here](http://unix.stackexchange.com/a/47406/22565) and [here](http://meta.unix.stackexchange.com/q/689/22565). `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