It usually helps when diagnosing a problem to detail exactly what the symptoms are. How about posting the output/error message you do get?
find -type f -path ...
The usual syntax is to give the top level directory(ies) to search from as the first argument(s), before any matching options. If you don't specify anything, then find
defaults to searching pwd
. So if you run the command from /
, for example, it will search the whole system, which will most likely work, but will be searching a much larger space than necessary for your needs.
is one of several options you can use to match specific file name patterns inside the given search space. Since you say you want to find all
older files, you shouldn't need to use it, assuming you give it a reasonable starting path first.
But then there's this:
-path /Volumes/XRAID/* "*.*
The path given here is nonsensical. First of all, there's only a single quote-mark (which is a shell syntax error and should keep the command from executing), and some odd-looking, unprotected, globbing patterns.
Remember that the shell has it's own globbing feature that gets expanded before the command is run, so /Volumes/XRAID/*
will expand to /Volumes/XRAID/file1 /Volumes/XRAID/file2 /Volumes/XRAID/file3
, etc, before the command is run, and similarly *.*
will expand to almost all files in the current directory. You have to be careful to quote any globbing or regex patterns to protect them from the shell and have them passed to find
are used when you want to define a specific output format for the results. But you haven't supplied the option with a format string to use. If you don't need the file names in the output to be structured in any particular way, just use -fprint
. If you do need to use printf
, check the manpage for the appropriate syntax and available formatting options.
So in all, I would suggest something more like this:
find /Volumes/XRAID -type f -mtime +720 -fprint /textfile.txt
This will search the /Volumes/XRAID
directory tree for all normal files that are older than 720 days, and output the list to the text file.
Edit: Here are a couple of links about using find: