find コマンドで特定のファイルを除外して検索する

published:

find コマンドで、特定のファイルを検索の対象から除外する。

find コマンド

find はファイルやディレクトリを検索するコマンド。

次の例では、 CSV を除くファイルが表示される。

$ find . -type f -not -name '*.csv'

次の例では、 example.txt を除くテキストファイルが表示される。

$ find . -type f -name '*.txt' -not -name 'example.txt'

Previous Article

Next Article