LANG/Shell Script

    [shell] rm 명령어 특정파일 or 특정확장자 제외하고 모든 파일/디렉터리 지우기

    Remove all files/directories except for one file using rm command Background 파일을 혹은 디렉터리를 생성할때 하나의 파일이나 특정 파일타입을 제외하고 나머지를 지우고 싶은 상황이 잦았다. How To POSIX find . ! -name 'file.txt' -type f -exec rm -f {} + 'file.txt'를 제외한 모든 일반 파일을 삭제한다(숨김파일 포함). find . ! -name 'file.txt' -type d -exec rm -rf {} + 'file.tex'를 제외한 모든 디렉터리를 삭제한다. 둘다 제거하는 경우도 몇번의 과정을 Text하였다. -type f -o..

    [Bash] 어렵다.. 링크 저장중.

    Bash 입문자를 위한 핵심 요약 정리 (Shell Script) 고급 Bash 스크립팅 가이드 What is the difference between the Bash operators [[ vs [ vs ( vs ((? bash substring extraction