Chapter 10: The find Command

The following was removed from Chapter 10: “The find Command”.

Print find Results into a File

find -fprint

Every time we’ve used find, we have assumed that the -print option isn’t necessary because it’s on by default. If you want to print to a file instead of the terminal, you use the -fprint option, followed by the name of the file you want to create.

$ find . ! \( -name "*mp*" -o -name "*ogg" -o -name "*flac" -o -type d \) -fprint non_music_files.txt
$ cat non_music_files.txt
[Results truncated for length]

You can then use these results in scripts, or send them to a printer if that would be helpful.

WebSanity Top Secret