kanta's spike

複数存在する空のディレクトリにまとめて.gitkeepファイルを作成したい。

解決策

以下のコマンドで空のディレクトリをリストアップできる。

find . -type d -empty

これを使って、forでまとめて.gitkeepを作成する。

for i in $(find . -type d -empty)
do
  touch $i/.gitkeep
done

参照

作成日: 2024/03/29