LoginSignup
9
10

More than 5 years have passed since last update.

「find: パス名は評価式の前に置かなければいけません」と怒られた場合の対処

Posted at

Linuxにてfindで以下のように検索したら怒られた。

$ find . -name *山口* -print0 | xargs -0 ls
find: パス名は評価式の前に置かなければいけません: tv - 山口県101回.mp4
使用法: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]

アスタリスクがある場合はダブルクオーテーションで囲う必要があるらしい。これでちゃんと出てきた。

$ find . -name "*山口*" -print0 | xargs -0 ls
./old/201310261444/tv - 山口県101回.mp4     ./tv - 山口第129回.mp4  ./tv - 山口県132回.mp4  ./tv - 山口第130回.mp4  ./tv - 山口第133回.mp4

参考にしたページ
かけだしエンジニアの独り言 http://blog.livedoor.jp/kistame228/?p=4

9
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
10