2012-01-18
파일이 너무 커서 열리지 않거나, 해당 파일을 자신이 원하는 사이즈에 맞게 나누거나 할때 유용한 명령어 이다.

사용법: split [<옵션>] [<입력> [<접두어>]]
split --help 라고 쳤을때 나오는 문구
Output fixed-size pieces of INPUT to PREFIXaa, PREFIXab, ...; default size is 1000 lines, and default PREFIX is `x'. With no INPUT, or when INPUT is -, read standard input. 긴 옵션에서 꼭 필요한 인수는 짧은 옵션에도 꼭 필요합니다. -a, --suffix-length=N use suffixes of length N (default 2) -b, --bytes=SIZE put SIZE bytes per output file -C, --line-bytes=SIZE put at most SIZE bytes of lines per output file -d, --numeric-suffixes use numeric suffixes instead of alphabetic -l, --lines=NUMBER put NUMBER lines per output file --verbose 진단 내용을 각 출력 파일을 열기 직전에 표준 오류로 출력합니다 --help 이 도움말을 표시하고 끝냅니다 --version 버전 정보를 출력하고 끝냅니다

간단히 예제를 들어주자면,
split -b 1048576 [나눌파일의경로및이름] [생성될파일경로및접두어]
split -b 1048576 tlinux/test.sql tlinux/sp
라는 식으로 명령어를 실행시킨다면, test.sql 파일이 1Mb씩 나뉘어서 spaa, spab, spac... 식으로 생성된다는 소리다.