1

I am using the diff command to compare directory and subdirectories' files like so:

 diff -bBE ./dir/* ../parent/dir/* >> diff.txt

But I am getting that :

 diff: extra operand `./dir/somefile'

The two directory and subdirectories' files are structured exactly the same way but their content is different. I don't know what I am missing.

4

1 回答 1

3

* is expanded by the shell, becoming (potentially) multiple arguments to diff. Just get rid of the *s; diff already knows how to handle directories.

于 2013-01-06T15:12:24.140 回答