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.

[View full width]

$ find . ! \( -name "*mp*" -o -name "*ogg" -o -name "*flac" -o -type d \) -fprint non_music_files.txt $ cat non_music_files.txt ./Folk/Joan_Baez/Joan_Baez_-_Imagine.m3u ./500_Greatest_Singles/singles.txt ./Blues/Muddy_Waters/Best_Of.m3u ./Blues/Robert_Johnson/Hellhound_On_My_Trail.MP3 ./Blues/Johnny_Winter/Johnny_Winter.m3u


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



Linux Phrasebook
Linux Phrasebook
ISBN: 0672328380
EAN: 2147483647
Year: 2007
Pages: 288

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net