명령 줄에서 대량으로 파일 이름을 바꾸는 방법은 무엇입니까?

공리

카메라에서 컴퓨터로 파일을 복사 할 때 파일 이름 확장자는 대문자입니다. 질문과 답변을 찾았 지만 제안 된 솔루션이 작동하지 않습니다.

내 질문은 제안 된 솔루션이 작동하지 않는 이유와 확장자를 소문자로 만들어 파일 이름 만 수정하도록 파일 이름을 변경하는 방법입니다.

참고 : 파일은 NAS (Synology DS1813 +)에 저장됩니다.

파일 이름을 바꾸려는 시도는 다음과 같습니다.

$ ls
IMG_8809.JPG  IMG_8813.JPG  IMG_8817.JPG  IMG_8821.JPG  IMG_8825.JPG  IMG_8829.JPG  IMG_8833.JPG  IMG_8837.JPG  IMG_8841.JPG  IMG_8845.JPG  IMG_8849.JPG  Thumbs.db
IMG_8810.JPG  IMG_8814.JPG  IMG_8818.JPG  IMG_8822.JPG  IMG_8826.JPG  IMG_8830.JPG  IMG_8834.JPG  IMG_8838.JPG  IMG_8842.JPG  IMG_8846.JPG  IMG_8850.JPG
IMG_8811.JPG  IMG_8815.JPG  IMG_8819.JPG  IMG_8823.JPG  IMG_8827.JPG  IMG_8831.JPG  IMG_8835.JPG  IMG_8839.JPG  IMG_8843.JPG  IMG_8847.JPG  IMG_8851.JPG
IMG_8812.JPG  IMG_8816.JPG  IMG_8820.JPG  IMG_8824.JPG  IMG_8828.JPG  IMG_8832.JPG  IMG_8836.JPG  IMG_8840.JPG  IMG_8844.JPG  IMG_8848.JPG  IMG_8852.JPG
$ find . -name '*.*' -exec sh -c 'a=$(echo {} | sed -r "s/([^.]*)\$/\L\1/"); [ "$a" != "{}" ] && mv "{}" "$a" ' \;
mv: ‘./IMG_8835.JPG’ and ‘./IMG_8835.jpg’ are the same file
mv: ‘./IMG_8822.JPG’ and ‘./IMG_8822.jpg’ are the same file
mv: ‘./IMG_8830.JPG’ and ‘./IMG_8830.jpg’ are the same file
mv: ‘./IMG_8850.JPG’ and ‘./IMG_8850.jpg’ are the same file
mv: ‘./IMG_8820.JPG’ and ‘./IMG_8820.jpg’ are the same file
mv: ‘./IMG_8826.JPG’ and ‘./IMG_8826.jpg’ are the same file
mv: ‘./IMG_8847.JPG’ and ‘./IMG_8847.jpg’ are the same file
mv: ‘./IMG_8816.JPG’ and ‘./IMG_8816.jpg’ are the same file
mv: ‘./IMG_8819.JPG’ and ‘./IMG_8819.jpg’ are the same file
mv: ‘./IMG_8814.JPG’ and ‘./IMG_8814.jpg’ are the same file
mv: ‘./IMG_8810.JPG’ and ‘./IMG_8810.jpg’ are the same file
mv: ‘./IMG_8817.JPG’ and ‘./IMG_8817.jpg’ are the same file
mv: ‘./IMG_8809.JPG’ and ‘./IMG_8809.jpg’ are the same file
mv: ‘./IMG_8851.JPG’ and ‘./IMG_8851.jpg’ are the same file
mv: ‘./IMG_8844.JPG’ and ‘./IMG_8844.jpg’ are the same file
mv: ‘./IMG_8818.JPG’ and ‘./IMG_8818.jpg’ are the same file
mv: ‘./IMG_8823.JPG’ and ‘./IMG_8823.jpg’ are the same file
mv: ‘./IMG_8848.JPG’ and ‘./IMG_8848.jpg’ are the same file
mv: ‘./IMG_8842.JPG’ and ‘./IMG_8842.jpg’ are the same file
mv: ‘./IMG_8815.JPG’ and ‘./IMG_8815.jpg’ are the same file
mv: ‘./IMG_8837.JPG’ and ‘./IMG_8837.jpg’ are the same file
mv: ‘./IMG_8827.JPG’ and ‘./IMG_8827.jpg’ are the same file
mv: ‘./IMG_8825.JPG’ and ‘./IMG_8825.jpg’ are the same file
mv: ‘./IMG_8840.JPG’ and ‘./IMG_8840.jpg’ are the same file
mv: ‘./IMG_8812.JPG’ and ‘./IMG_8812.jpg’ are the same file
mv: ‘./IMG_8811.JPG’ and ‘./IMG_8811.jpg’ are the same file
mv: ‘./IMG_8836.JPG’ and ‘./IMG_8836.jpg’ are the same file
mv: ‘./IMG_8828.JPG’ and ‘./IMG_8828.jpg’ are the same file
mv: ‘./IMG_8832.JPG’ and ‘./IMG_8832.jpg’ are the same file
mv: ‘./IMG_8839.JPG’ and ‘./IMG_8839.jpg’ are the same file
mv: ‘./IMG_8831.JPG’ and ‘./IMG_8831.jpg’ are the same file
mv: ‘./IMG_8824.JPG’ and ‘./IMG_8824.jpg’ are the same file
mv: ‘./IMG_8813.JPG’ and ‘./IMG_8813.jpg’ are the same file
mv: ‘./IMG_8843.JPG’ and ‘./IMG_8843.jpg’ are the same file
mv: ‘./IMG_8846.JPG’ and ‘./IMG_8846.jpg’ are the same file
mv: ‘./IMG_8829.JPG’ and ‘./IMG_8829.jpg’ are the same file
mv: ‘./IMG_8821.JPG’ and ‘./IMG_8821.jpg’ are the same file
mv: ‘./IMG_8838.JPG’ and ‘./IMG_8838.jpg’ are the same file
mv: ‘./IMG_8833.JPG’ and ‘./IMG_8833.jpg’ are the same file
mv: ‘./IMG_8834.JPG’ and ‘./IMG_8834.jpg’ are the same file
mv: ‘./IMG_8845.JPG’ and ‘./IMG_8845.jpg’ are the same file
mv: ‘./IMG_8841.JPG’ and ‘./IMG_8841.jpg’ are the same file
mv: ‘./IMG_8852.JPG’ and ‘./IMG_8852.jpg’ are the same file
mv: ‘./IMG_8849.JPG’ and ‘./IMG_8849.jpg’ are the same file
$ ls
IMG_8809.JPG  IMG_8813.JPG  IMG_8817.JPG  IMG_8821.JPG  IMG_8825.JPG  IMG_8829.JPG  IMG_8833.JPG  IMG_8837.JPG  IMG_8841.JPG  IMG_8845.JPG  IMG_8849.JPG  Thumbs.db
IMG_8810.JPG  IMG_8814.JPG  IMG_8818.JPG  IMG_8822.JPG  IMG_8826.JPG  IMG_8830.JPG  IMG_8834.JPG  IMG_8838.JPG  IMG_8842.JPG  IMG_8846.JPG  IMG_8850.JPG
IMG_8811.JPG  IMG_8815.JPG  IMG_8819.JPG  IMG_8823.JPG  IMG_8827.JPG  IMG_8831.JPG  IMG_8835.JPG  IMG_8839.JPG  IMG_8843.JPG  IMG_8847.JPG  IMG_8851.JPG
IMG_8812.JPG  IMG_8816.JPG  IMG_8820.JPG  IMG_8824.JPG  IMG_8828.JPG  IMG_8832.JPG  IMG_8836.JPG  IMG_8840.JPG  IMG_8844.JPG  IMG_8848.JPG  IMG_8852.JPG

또한 동일한 결과로이 명령을 시도했습니다.

$ rename s/.JPG/.jpg/ *.JPG
IMG_8809.JPG not renamed: IMG_8809.jpg already exists
IMG_8810.JPG not renamed: IMG_8810.jpg already exists
IMG_8811.JPG not renamed: IMG_8811.jpg already exists
IMG_8812.JPG not renamed: IMG_8812.jpg already exists
IMG_8813.JPG not renamed: IMG_8813.jpg already exists
IMG_8814.JPG not renamed: IMG_8814.jpg already exists
IMG_8815.JPG not renamed: IMG_8815.jpg already exists
IMG_8816.JPG not renamed: IMG_8816.jpg already exists
IMG_8817.JPG not renamed: IMG_8817.jpg already exists
IMG_8818.JPG not renamed: IMG_8818.jpg already exists
IMG_8819.JPG not renamed: IMG_8819.jpg already exists
IMG_8820.JPG not renamed: IMG_8820.jpg already exists
IMG_8821.JPG not renamed: IMG_8821.jpg already exists
IMG_8822.JPG not renamed: IMG_8822.jpg already exists
IMG_8823.JPG not renamed: IMG_8823.jpg already exists
IMG_8824.JPG not renamed: IMG_8824.jpg already exists
IMG_8825.JPG not renamed: IMG_8825.jpg already exists
IMG_8826.JPG not renamed: IMG_8826.jpg already exists
IMG_8827.JPG not renamed: IMG_8827.jpg already exists
IMG_8828.JPG not renamed: IMG_8828.jpg already exists
IMG_8829.JPG not renamed: IMG_8829.jpg already exists
IMG_8830.JPG not renamed: IMG_8830.jpg already exists
IMG_8831.JPG not renamed: IMG_8831.jpg already exists
IMG_8832.JPG not renamed: IMG_8832.jpg already exists
IMG_8833.JPG not renamed: IMG_8833.jpg already exists
IMG_8834.JPG not renamed: IMG_8834.jpg already exists
IMG_8835.JPG not renamed: IMG_8835.jpg already exists
IMG_8836.JPG not renamed: IMG_8836.jpg already exists
IMG_8837.JPG not renamed: IMG_8837.jpg already exists
IMG_8838.JPG not renamed: IMG_8838.jpg already exists
IMG_8839.JPG not renamed: IMG_8839.jpg already exists
IMG_8840.JPG not renamed: IMG_8840.jpg already exists
IMG_8841.JPG not renamed: IMG_8841.jpg already exists
IMG_8842.JPG not renamed: IMG_8842.jpg already exists
IMG_8843.JPG not renamed: IMG_8843.jpg already exists
IMG_8844.JPG not renamed: IMG_8844.jpg already exists
IMG_8845.JPG not renamed: IMG_8845.jpg already exists
IMG_8846.JPG not renamed: IMG_8846.jpg already exists
IMG_8847.JPG not renamed: IMG_8847.jpg already exists
IMG_8848.JPG not renamed: IMG_8848.jpg already exists
IMG_8849.JPG not renamed: IMG_8849.jpg already exists
IMG_8850.JPG not renamed: IMG_8850.jpg already exists
IMG_8851.JPG not renamed: IMG_8851.jpg already exists
IMG_8852.JPG not renamed: IMG_8852.jpg already exists

편집하다

파일 시스템 및 대소 문자 구분 문제에 대한 질문을 참조하십시오 .

공리

친구가 나를 지적 . 링크 된 기사는 길이가 8 페이지이지만 설명이 자세합니다. 대답의 짧은 버전은 다음과 같습니다.

... And that brings me to what I really want to discuss, which is how 
CIFS Server (Samba) deals with this.

As you would expect from an application that was grown to bridge 
the gap between the Unix and Windows worlds, it is very flexible. 
This is both good and bad - with flexibility comes responsibility, 
and sometimes not a little confusion. There are four configuration 
options that Samba provides to allow one to define its behavior 
when dealing with matters of 'case': 

preserve case = (yes/no) 
short preserve case = (yes/no) 
default case = (upper/lower) 
case sensitive = (yes/no)

해결책은 Samba구성 하여 특정 요구에 맞는 방식으로 대소 문자 구분 (또는 대소 문자 보존 문제)을 처리하는 것입니다.

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

jar의 파일을 Linux에서 명령 줄로 바꾸는 방법은 무엇입니까?

분류에서Dev

sed없이 명령 줄에서 (PHP) 파일의 이메일을 바꾸는 방법은 무엇입니까?

분류에서Dev

Unix에서 단일 명령 또는 스크립트로 여러 파일의 이름을 바꾸는 방법은 무엇입니까?

분류에서Dev

Windows 7 명령 프롬프트에서 네트워크 경로 (UNC 경로)에있는 파일의 이름을 바꾸는 방법은 무엇입니까?

분류에서Dev

배치 파일에서 여러 점이있는 파일의 이름을 대량으로 바꾸는 방법은 무엇입니까?

분류에서Dev

파일에서 fread ()를 명령 줄 인수로 바꾸는 방법은 무엇입니까?

분류에서Dev

한 줄의 여러 위치를 단일 검색으로 바꾸고 vim에서 명령을 바꾸는 방법은 무엇입니까?

분류에서Dev

Windows 명령 줄에서 경로없이 파일 이름 만 얻는 방법은 무엇입니까?

분류에서Dev

명령 줄 방법으로 DVD에서 파일을 복구하는 방법은 무엇입니까?

분류에서Dev

명령 줄 방법으로 DVD에서 파일을 복구하는 방법은 무엇입니까?

분류에서Dev

쉘 명령을 사용하여 밑줄로 파일 이름 묶음의 % 인코딩 문자를 바꾸는 방법은 무엇입니까?

분류에서Dev

Windows에서 Unix find 명령으로 파일 이름을 나열하는 방법은 무엇입니까?

분류에서Dev

vim 검색 세트가있는 파일을 소싱하고 vim에서 대화식으로 명령을 바꾸는 방법은 무엇입니까?

분류에서Dev

수정 날짜 순서대로 파일 이름을 숫자로 대량으로 바꾸는 방법은 무엇입니까?

분류에서Dev

파이썬에서 명령 (print, os. <...>)의 이름을 바꾸는 방법은 무엇입니까?

분류에서Dev

패턴에 따라 파일 이름을 대량으로 바꾸는 명령

분류에서Dev

명령 줄에서 기본 응용 프로그램으로 파일을 여는 방법은 무엇입니까?

분류에서Dev

명령 줄에서 기본 응용 프로그램으로 파일을 여는 방법은 무엇입니까?

분류에서Dev

명령 줄에서 기본 프로그램으로 파일을 여는 방법은 무엇입니까?

분류에서Dev

명령 줄에서 Excel 파일을 계산 파일로 변환하는 방법은 무엇입니까?

분류에서Dev

명령 줄에서 기존 emacs 프로세스에서 파일을 여는 방법은 무엇입니까?

분류에서Dev

명령 줄에서 sql.gz 파일을 일반 텍스트 SQL로 보는 방법은 무엇입니까?

분류에서Dev

linux 명령을 사용하여 이전 디렉토리 이름으로 .html 파일의 이름을 바꾸는 방법은 무엇입니까?

분류에서Dev

명령 줄에서 최근 파일을 보는 방법은 무엇입니까?

분류에서Dev

XML 파일 내용을 명령 줄 인수로 Java 명령에 전달하는 방법은 무엇입니까?

분류에서Dev

터미널에서 파일 이름을 일괄 적으로 바꾸는 방법은 무엇입니까?

분류에서Dev

Ubuntu에서 파일 이름을 일괄 적으로 바꾸는 방법은 무엇입니까?

분류에서Dev

한 번에 다른 이름으로 여러 파일의 이름을 바꾸는 방법은 무엇입니까?

분류에서Dev

명령 줄에서 gzip 파일을 암호로 보호하는 방법은 무엇입니까?

Related 관련 기사

  1. 1

    jar의 파일을 Linux에서 명령 줄로 바꾸는 방법은 무엇입니까?

  2. 2

    sed없이 명령 줄에서 (PHP) 파일의 이메일을 바꾸는 방법은 무엇입니까?

  3. 3

    Unix에서 단일 명령 또는 스크립트로 여러 파일의 이름을 바꾸는 방법은 무엇입니까?

  4. 4

    Windows 7 명령 프롬프트에서 네트워크 경로 (UNC 경로)에있는 파일의 이름을 바꾸는 방법은 무엇입니까?

  5. 5

    배치 파일에서 여러 점이있는 파일의 이름을 대량으로 바꾸는 방법은 무엇입니까?

  6. 6

    파일에서 fread ()를 명령 줄 인수로 바꾸는 방법은 무엇입니까?

  7. 7

    한 줄의 여러 위치를 단일 검색으로 바꾸고 vim에서 명령을 바꾸는 방법은 무엇입니까?

  8. 8

    Windows 명령 줄에서 경로없이 파일 이름 만 얻는 방법은 무엇입니까?

  9. 9

    명령 줄 방법으로 DVD에서 파일을 복구하는 방법은 무엇입니까?

  10. 10

    명령 줄 방법으로 DVD에서 파일을 복구하는 방법은 무엇입니까?

  11. 11

    쉘 명령을 사용하여 밑줄로 파일 이름 묶음의 % 인코딩 문자를 바꾸는 방법은 무엇입니까?

  12. 12

    Windows에서 Unix find 명령으로 파일 이름을 나열하는 방법은 무엇입니까?

  13. 13

    vim 검색 세트가있는 파일을 소싱하고 vim에서 대화식으로 명령을 바꾸는 방법은 무엇입니까?

  14. 14

    수정 날짜 순서대로 파일 이름을 숫자로 대량으로 바꾸는 방법은 무엇입니까?

  15. 15

    파이썬에서 명령 (print, os. <...>)의 이름을 바꾸는 방법은 무엇입니까?

  16. 16

    패턴에 따라 파일 이름을 대량으로 바꾸는 명령

  17. 17

    명령 줄에서 기본 응용 프로그램으로 파일을 여는 방법은 무엇입니까?

  18. 18

    명령 줄에서 기본 응용 프로그램으로 파일을 여는 방법은 무엇입니까?

  19. 19

    명령 줄에서 기본 프로그램으로 파일을 여는 방법은 무엇입니까?

  20. 20

    명령 줄에서 Excel 파일을 계산 파일로 변환하는 방법은 무엇입니까?

  21. 21

    명령 줄에서 기존 emacs 프로세스에서 파일을 여는 방법은 무엇입니까?

  22. 22

    명령 줄에서 sql.gz 파일을 일반 텍스트 SQL로 보는 방법은 무엇입니까?

  23. 23

    linux 명령을 사용하여 이전 디렉토리 이름으로 .html 파일의 이름을 바꾸는 방법은 무엇입니까?

  24. 24

    명령 줄에서 최근 파일을 보는 방법은 무엇입니까?

  25. 25

    XML 파일 내용을 명령 줄 인수로 Java 명령에 전달하는 방법은 무엇입니까?

  26. 26

    터미널에서 파일 이름을 일괄 적으로 바꾸는 방법은 무엇입니까?

  27. 27

    Ubuntu에서 파일 이름을 일괄 적으로 바꾸는 방법은 무엇입니까?

  28. 28

    한 번에 다른 이름으로 여러 파일의 이름을 바꾸는 방법은 무엇입니까?

  29. 29

    명령 줄에서 gzip 파일을 암호로 보호하는 방법은 무엇입니까?

뜨겁다태그

보관