Using the find command is there a way to combine options:
i.e.
find . -type fd -name "somefile"
Although -type ignores the second option; I'm looking to find only files or directories.
You cannot combine characters after -type (unless you have a different find than I have). You have to do something like:
find . \( -type f -o -type d \) -name "somefile"
On my system:
$ find . -type fd -name "somefile"
find: Arguments to -type should contain only one letter
That messages comes from the function insert_type() at line 2601 in
findutils-4.4.2 find/parser.c. It just takes the first character, older/other versions of find did IIRC not even warn if there were multiple characters after -type.
fd would be the combination of an argument to option -type not an option itself. It is just programmed that way find's option handling with single dashes but long option names is IMHO strange anyway. I'll update the question.
Came across this question during my studies. Two years into the future from your question and someone has added the feature into find and it's been integrated into Debian and from there Ubuntu. Doesn't appear to be integrated into Red Hat yet (sad) but may be in Fedora (haven't checked).
find / -mmin -300 -type f -o -type d -exec ls -l {} \;
OR
find / -mmin -300 -type f,d -exec file {} \;
See this thread for details.
fis for regular files, not files (other types are files as well).