The Linux software for splitting the string.
문자열을 분할하는 리눅스 소프트웨어.
1. Feature 특징
01. Easy to use.
간편한 사용
간편한 사용
2. How to install 설치 방법
01. The basic software of Linux.
리눅스 기본 소프트웨어.
리눅스 기본 소프트웨어.
3. How to use 사용법
$ cat ./test
1234 5678 9012
1234567890
123 456 789
123 456 789
1234 5678 9012
1234567890
123 456 789
123 456 789
< The text for a test >
❑ Extract string using index number.
인덱스로 문자열 추출.
인덱스로 문자열 추출.
# 1~5 위치의 문자열 선택.
$ cut -c 1-5 ./test
1234
12345
123 4
123 4
$
$
# 1~5 바이트 문자열 선택.
$ cut -b 1-5 ./test
1234
12345
123 4
123 4
$ cut -c 1-5 ./test
1234
12345
123 4
123 4
$
$
# 1~5 바이트 문자열 선택.
$ cut -b 1-5 ./test
1234
12345
123 4
123 4
❑ Extract string using a delimiter.
구분자를 사용하여 문자열 추출.
구분자를 사용하여 문자열 추출.
# The default delimiter is the TAB character. 기본 구분자는 TAB 문자.
# Select the first string in the list. 리스트 중 첫 번째 문자열 선택.
$ cut -f 1 ./test
1234 5678 9012
1234567890
123 456 789
123
$
$
# Set the space character to the delimiter. 공백문자를 구분자로 설정.
$ cut -d " " -f 1 ./test
1234
1234567890
123
123 456 789
$
$
# Select the second string in the list. 리스트 중 두 번째 문자열 선택.
$ cut -d " " -f 2 ./test
5678
1234567890
456
123 456 789
$
$
# Select the third string in the list. 리스트 중 세 번째 문자열 선택.
$ cut -d " " -f 3 ./test
9012
1234567890
789
123 456 789
# Select the first string in the list. 리스트 중 첫 번째 문자열 선택.
$ cut -f 1 ./test
1234 5678 9012
1234567890
123 456 789
123
$
$
# Set the space character to the delimiter. 공백문자를 구분자로 설정.
$ cut -d " " -f 1 ./test
1234
1234567890
123
123 456 789
$
$
# Select the second string in the list. 리스트 중 두 번째 문자열 선택.
$ cut -d " " -f 2 ./test
5678
1234567890
456
123 456 789
$
$
# Select the third string in the list. 리스트 중 세 번째 문자열 선택.
$ cut -d " " -f 3 ./test
9012
1234567890
789
123 456 789
Check environment 점검 환경 | |||
O S | Windows 7(64 bits) | CPU | Intel i7 |
SHELL | Bash 4.4.12(3)(cygwin) |