5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ファイル名を小文字へ(カレントディレクトリ)

Last updated at Posted at 2015-11-12

こんにちは。
カレントディレクトリの全てのファイルを、大文字混じりのファイル名から小文字に変更してみました。各種を試しました。

$ rename -f 'y/A-Z/a-z/' *
$ for f in * ; do mv $f `echo $f | tr A-Z a-z`; done
$ for f in * ; do mv $f `echo $f | awk '{print tolower($0)}'`; done
$ for f in * ; do mv $f `echo ${f,,}`; done     [bash 4 以降]
$ ls | xargs -I % mv % `echo % | tr A-Z a-z`
$ echo "autoload zmv; zmv '(*)' '${(L)1}'" | zsh -s
  1. homebrew を利用しても入手できます。

5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?