Question: I’m using Sun Solaris OS. When I execute the find command, I get “find: bad option -not” as shown below. How do I fix the following error?
find: bad option -not find: path-list predicate-list" in Solaris SunOS.
Answer: In Linux, find command with -not option is used for inverting the match.
For example:
$ find . -not -name '*.txt' ./509edca2-8636-7542-1845-cafd3cab4c39_header.xml ./68d32b32-8638-7542-0e45-8c374f03f56b_header.xml ./mondbfile.sql
This command finds all the files and directories which doesnot have .txt at the filename. For more examples, refer our earlier article Mommy, I found it! — 15 Practical Linux Find Command Examples
Now, execution of the above command in Solaris will fail with the “bad option -not” message.
$ find . -not -name '*.txt' find: bad option -not find: path-list predicate-list
On Solaris, use ! operator to perform inverse matching as shown below.
$ find . ! -name '*.txt' ./509edca2-8636-7542-1845-cafd3cab4c39_header.xml ./68d32b32-8638-7542-0e45-8c374f03f56b_header.xml ./mondbfile.sql
Linux provides several powerful administrative tools and utilities which will help you to manage your systems effectively. If you don’t know what these tools are and how to use them, you could be spending lot of time trying to perform even the basic administrative tasks. The focus of this course is to help you understand system administration tools, which will help you to become an effective Linux system administrator.Get the Linux Sysadmin Course Now!
If you enjoyed this article, you might also like..
|
|
|
|






My name is Ramesh Natarajan. I will be posting instruction guides, how-to, troubleshooting tips and tricks on Linux, database, hardware, security and web. My focus is to write articles that will either teach you or help you resolve a problem. Read more about