Much like in many environments, it's certainly possible to have multiple files with the same name in several locations.
There are several ways to see if the files are identical (or indeed are the same file with multiple links).
First, you can use a tool such as diff
to compare the contents of files. If they are different, you will be shown the differences (or informed that they are different if the files are interpreted to be binary files):
diff /etc/rc.d/init.d/rabbitmq-server /etc/logrotate.d/rabbitmq-server
Secondly, you can use the long form of ls
to see if a file is a symbolic (or "soft" link. This will show both that a given file is a symbolic link, and the location to which it points:
$ ls -l bar
lrwxrwxrwx 1 ghoti ghoti 3 Aug 18 18:34 bar -> foo
The l
in the first column shows that bar
is a link, and the end of the line, bar -> foo
, shows that foo
is the location to which bar
points.
ls -l
will also show you how many hard links a file has:
$ ls -l foo
-rw-rw-r-- 2 ghoti ghoti 0 Aug 18 18:36 foo
In this case, the 2
between the permissions and the owner shows that foo
is a file to which there are two hard links. You can use find
to locate files that are hardlinks to the same file:
find / -samefile foo
The above command will search the entire filesystem for all hardlinks to foo
As to your question about the correct way to start rabbitmq
, this is best found by consulting the manual page:
man rabbitmq