YZMSQ
April 8th, 2011, 15:34
Hello, there:
I'm now learning command line from scratch on FreeBSD, and now there's a problem relating to "find" confusing me. In "find" manual, it introduces the "-f" option with following description:
-f Specify a file hierarchy for find to traverse. File hierarchies
may also be specified as the operands immediately following the
options.
However, there's no further guide and example for that. I tried it myself with these output:
justin@zust.pts/0 ~ % ls test/mydoc/myfile/
myfile mytime myway
justin@zust.pts/0 ~ % find test/mydoc/myfile/ -type f -iname "*way*"
test/mydoc/myfile/myway
justin@zust.pts/0 ~ % find -f ~/test/mydoc/myfile -type f -iname "*way*"
find: illegal option -- t
find: illegal option -- y
find: illegal option -- p
find: illegal option -- e
/home/justin/test/mydoc/myfile/myway
find: f: No such file or directory
justin@zust.pts/0 ~ % find -f ~/test/ mydoc/myfile -type f -iname "*way*"
/home/justin/test/mydoc/myfile/myway
find: mydoc/myfile: No such file or directory
justin@zust.pts/0 ~ % find -f ~ /test/mydoc/myfile -type f -iname "*way*"
/home/justin/Art/music/Secret Garden/Always There.mp3
/home/justin/Download/11.A Thousand Miles Away.mp3
/home/justin/Download/12.Gifts Along The Way.mp3
/home/justin/Download/14.Always Near.mp3
/home/justin/Personal_University/其它/The_Open_Source_Way.pdf
/home/justin/.goldendict/WyabdcRealPeopleTTS/a/always.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/a/anyway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/a/away.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/b/breezeway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/d/doorway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/f/freeway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/g/gangway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/g/gateway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/h/hallway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/h/headway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/h/highway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/l/leeway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/m/motorway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/r/railway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/r/roadway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/s/sideways.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/s/slantways.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/s/stairway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/s/stowaway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/s/subway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/s/sway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/w/way.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/w/waylaid.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/w/waylay.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/w/wayward.wav
/home/justin/.lyrics/Always There.lrc
/home/justin/.icons/Macbuntu-Icons/status/24/user-away.png
/home/justin/.icons/Macbuntu-Icons/status/24/user-away-panel.png
/home/justin/.icons/Macbuntu-Icons/status/24/empathy-away.png
/home/justin/.icons/Macbuntu-Icons/status/24/empathy-extended-away.png
/home/justin/.icons/Macbuntu-Icons/status/22/user-away.png
/home/justin/.icons/Macbuntu-Icons/status/22/user-away-panel.png
/home/justin/.icons/Macbuntu-Icons/status/22/empathy-away.png
/home/justin/.icons/Macbuntu-Icons/status/22/empathy-extended-away.png
/home/justin/.icons/Macbuntu-Icons/status/16/user-away.png
/home/justin/.icons/Macbuntu-Icons/status/16/user-away-panel.png
/home/justin/.icons/Macbuntu-Icons/status/16/empathy-away.png
/home/justin/.icons/Macbuntu-Icons/status/16/empathy-extended-away.png
/home/justin/.icons/Macbuntu-Icons/apps/scalable/kopete_some_away.png
/home/justin/.icons/Macbuntu-Icons/apps/scalable/kopete_all_away.png
/home/justin/test/mydoc/myfile/myway
find: /test/mydoc/myfile: No such file or directory
So, could you help me, please? Thank you in advance. :P
I'm now learning command line from scratch on FreeBSD, and now there's a problem relating to "find" confusing me. In "find" manual, it introduces the "-f" option with following description:
-f Specify a file hierarchy for find to traverse. File hierarchies
may also be specified as the operands immediately following the
options.
However, there's no further guide and example for that. I tried it myself with these output:
justin@zust.pts/0 ~ % ls test/mydoc/myfile/
myfile mytime myway
justin@zust.pts/0 ~ % find test/mydoc/myfile/ -type f -iname "*way*"
test/mydoc/myfile/myway
justin@zust.pts/0 ~ % find -f ~/test/mydoc/myfile -type f -iname "*way*"
find: illegal option -- t
find: illegal option -- y
find: illegal option -- p
find: illegal option -- e
/home/justin/test/mydoc/myfile/myway
find: f: No such file or directory
justin@zust.pts/0 ~ % find -f ~/test/ mydoc/myfile -type f -iname "*way*"
/home/justin/test/mydoc/myfile/myway
find: mydoc/myfile: No such file or directory
justin@zust.pts/0 ~ % find -f ~ /test/mydoc/myfile -type f -iname "*way*"
/home/justin/Art/music/Secret Garden/Always There.mp3
/home/justin/Download/11.A Thousand Miles Away.mp3
/home/justin/Download/12.Gifts Along The Way.mp3
/home/justin/Download/14.Always Near.mp3
/home/justin/Personal_University/其它/The_Open_Source_Way.pdf
/home/justin/.goldendict/WyabdcRealPeopleTTS/a/always.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/a/anyway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/a/away.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/b/breezeway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/d/doorway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/f/freeway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/g/gangway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/g/gateway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/h/hallway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/h/headway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/h/highway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/l/leeway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/m/motorway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/r/railway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/r/roadway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/s/sideways.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/s/slantways.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/s/stairway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/s/stowaway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/s/subway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/s/sway.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/w/way.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/w/waylaid.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/w/waylay.wav
/home/justin/.goldendict/WyabdcRealPeopleTTS/w/wayward.wav
/home/justin/.lyrics/Always There.lrc
/home/justin/.icons/Macbuntu-Icons/status/24/user-away.png
/home/justin/.icons/Macbuntu-Icons/status/24/user-away-panel.png
/home/justin/.icons/Macbuntu-Icons/status/24/empathy-away.png
/home/justin/.icons/Macbuntu-Icons/status/24/empathy-extended-away.png
/home/justin/.icons/Macbuntu-Icons/status/22/user-away.png
/home/justin/.icons/Macbuntu-Icons/status/22/user-away-panel.png
/home/justin/.icons/Macbuntu-Icons/status/22/empathy-away.png
/home/justin/.icons/Macbuntu-Icons/status/22/empathy-extended-away.png
/home/justin/.icons/Macbuntu-Icons/status/16/user-away.png
/home/justin/.icons/Macbuntu-Icons/status/16/user-away-panel.png
/home/justin/.icons/Macbuntu-Icons/status/16/empathy-away.png
/home/justin/.icons/Macbuntu-Icons/status/16/empathy-extended-away.png
/home/justin/.icons/Macbuntu-Icons/apps/scalable/kopete_some_away.png
/home/justin/.icons/Macbuntu-Icons/apps/scalable/kopete_all_away.png
/home/justin/test/mydoc/myfile/myway
find: /test/mydoc/myfile: No such file or directory
So, could you help me, please? Thank you in advance. :P