Quote:
Originally Posted by nixanwin
I keep getting the following error but don't know how to fix it. Is what I am trying to do even possible?
find: warning: you have specified the -maxdepth option after a non-option argument -name, but options are not positional (-maxdepth affects tests specified before it as well as those specified after it). Please specify options before other arguments.
|
You're not getting an error. As the message says, you're getting a "warning." Typically, a warning does not stop the program, but alerts you that you may not get the results you expect. This warning tells you that the -maxdepth option should be placed
before -name on the command line. It also says that, in the case of -maxdepth, it will have the desired effect regardless.
In a nutshell, the program is telling you the
form of the command is not what the developers expect--certain command line switches can have different effects depending on where they are placed on the command line.
That said, I think your command is wrong for a different reason. You say you are looking for a "file" named "file1.xml" but your find command is looking for a directory (-type d). I think you probably intended "-type f"