タグ

findに関するnamikisterのブックマーク (2)

  • perl - the best friend of find(1) : 404 Blog Not Found

    2008年02月24日22:45 カテゴリLightweight Languages perl - the best friend of find(1) find(1)ネタというのも、定期的にネットを賑やかにする時候ネタになりつつあるようです。 いまさらxargsの便利さを主張してみる findでファイル検索入門 - builder by ZDNet Japan というわけで、いまさらfindとperlの相性のよさを再確認してみることにしてみます。 基形 まずは、これを覚えておきましょう。 find [options and args of find] -print0 | perl -l0ne 'perl program' findが見つけたファイルを一つ見つけると、perlの$_にそのファイル名が入るのでそれに対して何らかの処理を行います。 perl側の-l0neというのは、以下と同等

    perl - the best friend of find(1) : 404 Blog Not Found
    namikister
    namikister 2008/02/28
    find2perlかぁ
  • 勝手に添削 - find(1) : 404 Blog Not Found

    2007年03月30日00:15 カテゴリ一日一行野郎Lightweight Languages 勝手に添削 - find(1) 「ウノウラボ Unoh Labs: コマンドラインで作業する上で知っておくといいテクニック」の用法に首を傾げたので。 まずはこちら。 $ find . -type f | fgrep index.html これは % find . -type f -name index.html でOK。パイプ不要。.htmlだけ見つけたい時も % find . -type f -name \*.html でOK。findはシェルのワイルドカードを受け付ける。ただしシェルにそれを展開して欲しくないので、\でエスケープしている。要は $ find . -name '*~' と同じなのだが、なんで上記の例でfgrepを使っているか不明。 ここからが番。 $ find . -nam

    勝手に添削 - find(1) : 404 Blog Not Found
  • 1