find 报错 find: paths must precede expression:

Shell scripting, error, such as the following

[root@localhost backup]#find ./ -name mysqldump* -mtime +3 -delete
[root@localhost backup]#find: paths must precede expression: mysqldump.sql.gz
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]

Solve error mysqldump * single quotes

find ./ -name 'mysqldump*' -mtime +3 -delete

Or escape

find ./ -name mysqldump\* -mtime +3 -delete

 

Guess you like

Origin www.cnblogs.com/faberbeta/p/linux-shell001.html