Skip to main content
added 167 characters in body
Source Link
schily
  • 19.7k
  • 5
  • 41
  • 61

An operator named -not does not exist in find. did you mean !? -path is an extension found on many find implementations but not in all.

Your main problem may be that all path name arguments must appear first on the find command line and if you add a path name type argument past that expanded alias, you get find arguments in the wrong order.

A general solution for your problem does not exist since you may need to add further find arguments before or after the path to be excluded depending on the situation.

You may try:

find() {
    path=$1
    shift
    command find "$1̈́" ! -path '*.sync' "$@"
}

but this only allows one path type argument.

An operator named -not does not exist in find. did you mean !? -path is an extension found on many find implementations but not in all.

Your main problem may be that all path name arguments must appear first on the find command line and if you add a path name type argument past that expanded alias, you get find arguments in the wrong order.

A general solution for your problem does not exist since you may need to add further find arguments before or after the path to be excluded depending on the situation.

An operator named -not does not exist in find. did you mean !? -path is an extension found on many find implementations but not in all.

Your main problem may be that all path name arguments must appear first on the find command line and if you add a path name type argument past that expanded alias, you get find arguments in the wrong order.

A general solution for your problem does not exist since you may need to add further find arguments before or after the path to be excluded depending on the situation.

You may try:

find() {
    path=$1
    shift
    command find "$1̈́" ! -path '*.sync' "$@"
}

but this only allows one path type argument.

Source Link
schily
  • 19.7k
  • 5
  • 41
  • 61

An operator named -not does not exist in find. did you mean !? -path is an extension found on many find implementations but not in all.

Your main problem may be that all path name arguments must appear first on the find command line and if you add a path name type argument past that expanded alias, you get find arguments in the wrong order.

A general solution for your problem does not exist since you may need to add further find arguments before or after the path to be excluded depending on the situation.