-
-
Save hatappo/316ee920b5c10fe9785260f3bec2ba0f to your computer and use it in GitHub Desktop.
findとxargsでファイル名変更、そしてファイル名を戻す。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# カレントディレクトリ直下のマークダウンのファイルすべてに対して、ファイル名の末尾に '.org' を付与する | |
find ./ -type f -maxdepth 1 -name "*.md" | xargs -I% mv % %.org | |
# 上とまったく逆の操作。 末尾の '.org' を取り除く。 | |
find ./ -type f -maxdepth 1 -name "*.md.ignore" | sed 's/\.ignore$//' | xargs -I% mv %.org % | |
# いったん、ファイル名を退避して、ことが終わったらもとに戻す、とかのときに便利。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment