UNIX/コマンド/テキスト処理/sort


% sort [filename]
% sort [filename] [filename]

% cat [filename] | sort 
1 c
3 e
12 a
9 x
9 d
1 c
20 f
5 o
% sort [file1] 
1 c
12 a
3 e
9 x 
% sort -n [file1]
1 c
3 e
9 x 
12 a
% sort [file1] [file2]
1 c
1 c
12 a
20 f
3 e
5 o
9 d 
9 x 
% sort -u [file1] [file2]
1 c
12 a
20 f
3 e
5 o
9 d 
9 x
% sort -un [file1] [file2]
1 c
3 e
5 o
9 d
12 a
20 f

% sort +1 [file1]
12 a
1 c
3 e
9 x 


xrea