Vivek
Vivek

Reputation: 182

Find command not working as expected in centOS

I am using CentOS Linux release 7.0.1406 on virtual box. I am trying to find the files using find command.

this find command is not giving any response:

find . -name "orm.properties"

My current working directory is /eserver6. File orm.properties is present in /eserver6/share/system/config/cluster, but find command is not able to find the file.

I have tried other combinations like

find . -name "orm.*"
find . -name 'orm*'

this is finding few files staring with orm but not all the files present inside the current working directory.

Upvotes: 0

Views: 3866

Answers (2)

Aaron Digulla
Aaron Digulla

Reputation: 328800

The command line looks correct and it should find the file. Some reasons why it might fail:

  1. You don't have permission to enter one of the folders in the path to /eserver6/share/system/config/cluster.
  2. You made a typo
  3. The file system is remote and the remote file system behaves oddly
  4. There is a simlink somewhere in the path. By default, find doesn't follow symlinks to avoid recursive loops. Use find /eserver6 -L ... to tell find to look at the target of the link and follow it if it's a folder.

The command

find /eserver6 -name "orm.properties"

should definitely find the file, no matter where you are. If it doesn't, look at -D debugoptions in the manpage. You probably want -D stat to see at which files find looks and what it sees.

Upvotes: 2

smn_onrocks
smn_onrocks

Reputation: 1342

If your user have entry into sudoers file then its ok and you can run

sudo find / -name "orm.properties"

or else ask your admin to give an entry in sudoers file of your user and run the same command then it will work.

Upvotes: 0

Related Questions