find -name 〜 -exec ""{} \;みたいなコマンドがあるかと思いますが、ちょっと覚えられないですよね。
また、条件式を末尾ではなく途中に書くというのが書きづらい。
以下の方法は使いやすいと思いますのでどうぞ。
- ディレクトリ以下のphpファイルを全部vimで開きたい場合
$ find . | grep -v vendor | grep -v cache | grep php$
$ vim `!!`
- ディレクトリ以下にtest1〜test20までのフォルダを作ったが、やっぱり削除したい
$ mkdir $(printf test%d\ `seq 1 20`)
$ find . -type d | grep test
$ rmdir `!!`
- 指定したディレクトリの容量を表示したい
$ ls test*
$ du -sh `!!`
- その他使い方例
$ apt-cache search mplayer | cut -d ' ' -f 1
$ printf "[package: %s]\n" `!!`