Sorting and columns · 정렬 및 열
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · 이 페이지는 최신 브라우저(SharedArrayBuffer 지원)가 필요합니다. Chrome, Edge, Firefox 또는 Safari를 최신 버전으로 업데이트해 주세요.
English
Putting lines in order
sortarranges lines alphabetically (or, with-n, as numbers):
sort -rreverses the order;sort -nis for lists of numbers.
한국어
줄 정렬하기
sort는 줄을 알파벳 순서로 배치합니다(또는-n을 사용하면 숫자 순서):
sort names.txt
sort -r는 순서를 반전시키고,sort -n은 숫자 목록에 적합합니다.
English
Removing duplicates
uniqremoves neighbouring repeated lines. Because it only looks at neighbours, you usuallysortfirst:
- Add
uniq -cto also count how many times each line appeared.
한국어
중복 제거
uniq는 인접한 반복되는 줄만 제거합니다. 인접한 것만 보기 때문에 보통sort을 먼저 실행해야 합니다:
sort names.txt | uniq
uniq -c를 추가하면 각 줄이 몇 번 나타났는지 세어 줄 수 있습니다.
Explore · 탐색하기
sort, then uniq
uniq only sees neighbours — sort first, so the duplicates sit together. · uniq는 이웃만 보게 됩니다 — sort 먼저 하므로 중복된 것들이 함께 배치됩니다.
English
Picking out columns
- Many files have columns separated by a character — a comma, a colon, a tab.
cutpulls out the columns you want.-dsets the delimiter,-fthe field:
- That takes the first field of each
name:ageline — the names.
한국어
열 추출하기
- 많은 파일이 comma, colon, tab 같은 문자로 열이 분리되어 있습니다.
cut가 원하는 열을 추출합니다.-d은 delimiter(구분자)를 설정하고,-f은 field(필드)를 지정합니다:
cut -d : -f 1 people.txt
- 이는 각
name:age줄의 첫 번째 필드 — 이름들을 가져옵니다.
English
Common mistakes
sortis alphabetical;sort -nsorts numbers correctly.cutneeds the right delimiter with-d.
한국어
흔한 실수
sort는 알파벳순이며,sort -n은 숫자를 올바르게 정렬합니다.cut는 올바른 delimiter와 함께-d이 필요합니다.
Get a tidy, de-duplicated list of names. Pipe sort into uniq: sort names.txt | uniq. · 정리되고 중복이 제거된 이름 목록을 얻으십시오. sort를 uniq로 파이프하세요: sort names.txt | uniq.
people.txt has name:age on each line. Pull out just the names with cut -d : -f 1 people.txt. · people.txt의 각 줄에는 name:age이 있습니다. cut -d : -f 1 people.txt를 사용하여 이름만 추출하세요.