UNIX find

dotinstall:~ $ mkdir -p test/app{1..5}
dotinstall:~ $ touch test/app{1..5}/app{1..3}{.jpg,.png,.gif}
dotinstall:~ $ ls test/
app1 app2 app3 app4 app5
dotinstall:~ $ ls test/app1
app1.gif app1.png app2.jpg app3.gif app3.png
app1.jpg app2.gif app2.png app3.jpg
dotinstall:~ $ find test -name ‘app3.png’
test/app1/app3.png
test/app2/app3.png
test/app3/app3.png
test/app4/app3.png
test/app5/app3.png
dotinstall:~ $ find test -name ‘app1*’
test/app1
test/app1/app1.jpg
test/app1/app1.png
test/app1/app1.gif
test/app2/app1.jpg
test/app2/app1.png
test/app2/app1.gif
test/app3/app1.jpg
test/app3/app1.png
test/app3/app1.gif
test/app4/app1.jpg
test/app4/app1.png
test/app4/app1.gif
test/app5/app1.jpg
test/app5/app1.png
test/app5/app1.gif
dotinstall:~ $ find test -name ‘app1*’ -type f
test/app1/app1.jpg
test/app1/app1.png
test/app1/app1.gif
test/app2/app1.jpg
test/app2/app1.png
test/app2/app1.gif
test/app3/app1.jpg
test/app3/app1.png
test/app3/app1.gif
test/app4/app1.jpg
test/app4/app1.png
test/app4/app1.gif
test/app5/app1.jpg
test/app5/app1.png
test/app5/app1.gif
dotinstall:~ $ find test -name ‘app1*’ -type d
test/app1
dotinstall:~ $ rm -r test/
dotinstall:~ $

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です